Skip to content

Roadbridges - #122

Merged
pWn3d1337 merged 9 commits into
mainfrom
roadbridges
Sep 3, 2026
Merged

Roadbridges#122
pWn3d1337 merged 9 commits into
mainfrom
roadbridges

Conversation

@pWn3d1337

Copy link
Copy Markdown
Collaborator

No description provided.

pWn3d1337 and others added 9 commits August 29, 2026 14:06
# 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
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

⚠️ Title/Commit Validation Failed

Invalid PR title:

  • Roadbridges

Invalid commit messages:

  • road bridges push on repair
  • Sectional Bridge animations
  • bugfix(bridges): clear the deck of a destroyed bridge for good
  • bugfix(bridges): inherit RadarColor from DefaultBridge
  • bugfix(bridges): stop destroyed bridges blocking shots and effects
  • fix some road bridge stuff, deck height and bridge height
  • implement destructible road bridges
    PR titles and commit messages must follow conventional commits format:
type: Description
type(scope): Description

Allowed types: bugfix, build, chore, ci, docs, fix, feat, perf, refactor, revert, style, test, tweak, unify

See CONTRIBUTING.md for details.

@pWn3d1337
pWn3d1337 merged commit bc2dbcc into main Sep 3, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant