bugfix: Prevent building crash damage from dealing damage to other objects#2723
bugfix: Prevent building crash damage from dealing damage to other objects#2723Stubbjax wants to merge 3 commits into
Conversation
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp | Adds non-retail path that applies crash damage directly to the struck building via DamageInfo rather than firing an AoE weapon; null guard and FX call are both safe. |
| GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp | Zero Hour counterpart receives the identical change; no issues found. |
Sequence Diagram
sequenceDiagram
participant Physics as PhysicsBehavior::onCollide
participant WT as WeaponTemplate
participant WS as WeaponStore
participant Bldg as Building (other)
participant FX as FXList
Note over Physics: Vehicle falls into structure
alt RETAIL_COMPATIBLE_CRC
Physics->>WS: createAndFireTempWeapon(template, obj, pos)
WS->>Bldg: AoE explosion — damages building AND nearby units
else Non-retail (this PR)
Physics->>WT: getDamageType / getDeathType / getPrimaryDamage
WT-->>Physics: damage values
Note over Physics: weaponTemplate nullptr check
Physics->>Bldg: attemptDamage(DamageInfo) — building only
Physics->>FX: doFXObj(getFireFX, obj) — visual effect only
end
Physics->>Physics: destroyObject(obj)
Reviews (3): Last reviewed commit: "tweak: Assign source player mask" | Re-trigger Greptile
| damageInfo.in.m_amount = weaponTemplate->getPrimaryDamage(nullBonus); | ||
|
|
||
| other->attemptDamage(&damageInfo); | ||
| FXList::doFXObj(weaponTemplate->getFireFX(obj->getVeterancyLevel()), obj); |
There was a problem hiding this comment.
In #2204 it does not do this FX. Is that correct? Should not be consistent?
There was a problem hiding this comment.
There is no effect on the non-building weapon, but I suppose I could check whether there is and fire it if so fire it there too.
| #else | ||
| // TheSuperHackers @bugfix Stubbjax 17/05/2026 Prevent building collisions from dealing collateral damage to other objects. | ||
| const WeaponTemplate* weaponTemplate = getPhysicsBehaviorModuleData()->m_vehicleCrashesIntoBuildingWeaponTemplate; | ||
| if (weaponTemplate != nullptr) |
There was a problem hiding this comment.
In #2204 it does not test the template for null. Is that correct? Should not be consistent?
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