Roadbridges - #122
Merged
Merged
Conversation
# Conflicts: # Core/GameEngine/Include/GameClient/TerrainRoads.h
A collapsed bridge kept behaving like an intact one in three places, all of which only showed up now that road bridges can be destroyed from Roads.ini. getLayerForDestination handed out a rubbled bridge's layer. Its sibling getHighestLayerForDestination already filtered that case; this one relied on isPointOnBridge's hole test, which does nothing unless the road type defines BridgeHoleAreaPercentage. FXList and ObjectCreationList use the returned layer to place effects, so explosions and OCL spawns were lifted to the deck plane of a bridge that no longer existed. The span object's collision box is sized to the whole bridge at construction so area weapons aimed at the deck connect. ActiveBody only flattens Z when a structure rubbles, leaving the full major/minor radii behind, which keeps the wreck inside every FROM_BOUNDINGSPHERE range and splash query. Collapse the box instead, and rebuild it from the bridge on repair - the template geometry is only a placeholder, so restoring from it would be wrong. ActiveBody also sets OBJECT_STATUS_NO_COLLISIONS on the way down and never clears it, so a repaired span has to ask for collisions back. Projectiles tracking their pathfind layer now ask for healthy bridges only, so a flat trajectory crossing the plane of a wrecked deck no longer detonates on it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UF9NnxNqrmYH1XhNnyCqeb
newBridge copies every other field from the DefaultBridge block but never copied the radar colour, and TerrainRoadType starts out black, so any bridge block that omits RadarColor drew black on the radar instead of picking up the default. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UF9NnxNqrmYH1XhNnyCqeb
A destroyed bridge still behaved like a solid deck in several ways that only show once bridges can actually be destroyed and rebuilt. The hole punched at death was described by an optional polygon, so a road type without BridgeHoleAreaPercentage got no hole at all and every isPointOnBridge test kept reporting the wreck as intact. A holed bridge with no polygon now loses the whole deck, and the hole is punched for non-repairable bridges too, since the deck is just as gone either way. Nothing ever cleared the flag again, so repairing now closes the hole as well. Only procedural spans had their collision box collapsed on death. A landmark bridge keeps a box the size of the whole structure and the pathfinder stamps that into the ground, so the wreck went on blocking everything underneath. Collapse it for both kinds, and take the object out of the pathfind map and put it back around the change, otherwise the old footprint survives - the rubble re-stamp in ActiveBody runs before this and re-stamps the full box. Restoring the box afterwards has to stay split: a landmark bridge is authored with real geometry, a procedural span carries a placeholder and has to be sized from the bridge instead. Landmark bridges also never got OBJECT_STATUS_NO_COLLISIONS cleared on repair, since only the span path did that. Rider handling is unaffected: the kill pass in updateDamageState runs before onDie punches the hole, handleObjectsOnBridgeOnDie walks the bridge corners directly rather than through isPointOnBridge, and findBridgeAt ignores holes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UF9NnxNqrmYH1XhNnyCqeb
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.