You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change prevents collateral damage caused by VehicleCrashesIntoBuildingWeapon when a dead vehicle collides with a building. This fix is supplemental to #2204.
Before
The Tank Hunters receive damage if the dead Helix collides with the Bunker
INJURED.mp4
After
The Tank Hunters no longer receive damage if the dead Helix collides with the Bunker
Stubbjax
added
Bug
Something is not working right, typically is user facing
Minor
Severity: Minor < Major < Critical < Blocker
Gen
Relates to Generals
ZH
Relates to Zero Hour
NoRetail
This fix or change is not applicable with Retail game compatibility
labels
May 17, 2026
This PR fixes an unintended splash-damage side effect from VehicleCrashesIntoBuildingWeapon, guarded behind #if !RETAIL_COMPATIBLE_CRC, so the retail CRC path is unchanged. The fix is a direct supplement to #2204.
Instead of createAndFireTempWeapon (which fires an area weapon and can hit nearby units), the new path calls other->attemptDamage directly, targeting only the specific building that was collided with, then fires the fire FX on the crashing vehicle.
A null-guard for weaponTemplate is included, preventing crashes when the template is absent or set to None.
The same change is applied identically in both Generals/ and GeneralsMD/ to cover the base game and Zero Hour expansion.
Confidence Score: 5/5
The change is safe to merge — the retail CRC path is untouched, and the new non-retail path is well-guarded and tightly scoped.
The fix is logically correct: other is already confirmed non-null (checked via isKindOf(KINDOF_STRUCTURE) just above), weaponTemplate is now null-guarded, and damage is applied only to the collided building. No unguarded dereferences, no regression risk on the retail path, and both game variants (Generals and Zero Hour) receive the identical fix.
Adds direct single-target damage path for vehicle-building crashes behind !RETAIL_COMPATIBLE_CRC; null-guards the weapon template and fires FX on the crashing vehicle.
Identical change as the Generals/ counterpart applied to the Zero Hour expansion, with the same null-guard and direct damage approach.
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[onCollide triggered] --> B{other is KINDOF_STRUCTURE?}
B -- No --> C[Apply non-building crash weapon\nvia createAndFireTempWeapon]
B -- Yes --> D{obj is KINDOF_VEHICLE?}
D -- No --> E[destroyObject obj]
D -- Yes --> F{RETAIL_COMPATIBLE_CRC?}
F -- Yes --> G[createAndFireTempWeapon\nArea damage: hits nearby units]
F -- No --> H{weaponTemplate != nullptr?}
H -- No --> E
H -- Yes --> I[Build DamageInfo from\nprimary damage + type/death]
I --> J[other->attemptDamage\nOnly damages the building]
J --> K[FXList::doFXObj on obj\nFire FX on crashing vehicle]
K --> E
G --> E
xezon
changed the title
bugfix: Prevent building crash damage from dealing damage to other objects
bugfix(physics): Prevent building crash damage from dealing damage to other objects
May 20, 2026
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
BugSomething is not working right, typically is user facingGenRelates to GeneralsMinorSeverity: Minor < Major < Critical < BlockerNoRetailThis fix or change is not applicable with Retail game compatibilityZHRelates to Zero Hour
2 participants
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.
This change prevents collateral damage caused by
VehicleCrashesIntoBuildingWeaponwhen a dead vehicle collides with a building. This fix is supplemental to #2204.Before
The Tank Hunters receive damage if the dead Helix collides with the Bunker
INJURED.mp4
After
The Tank Hunters no longer receive damage if the dead Helix collides with the Bunker
HEALTHY.mp4