From eba6880d6a14795033140f63eb6a5b5de5e09b13 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Wed, 28 Jan 2026 03:03:14 +1100 Subject: [PATCH] bugfix: Prevent dead units from repeatedly dealing crash damage on collision with non-buildings --- .../Source/GameLogic/Object/Update/PhysicsUpdate.cpp | 5 +++++ .../Source/GameLogic/Object/Update/PhysicsUpdate.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp index 044d2ceeb3e..3eb8247a21e 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp @@ -1260,7 +1260,12 @@ void PhysicsBehavior::onCollide( Object *other, const Coord3D *loc, const Coord3 else { // fall into a nonbuilding -- whatever. if we're a vehicle, quietly do a little damage. +#if RETAIL_COMPATIBLE_CRC if (obj->isKindOf(KINDOF_VEHICLE)) +#else + // TheSuperHackers @bugfix Stubbjax 28/01/2026 Prevent dead units from repeatedly dealing damage. + if (obj->isKindOf(KINDOF_VEHICLE) && !obj->isEffectivelyDead()) +#endif { TheWeaponStore->createAndFireTempWeapon(getPhysicsBehaviorModuleData()->m_vehicleCrashesIntoNonBuildingWeaponTemplate, obj, obj->getPosition()); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp index eb81af5cb3b..67e391d26e6 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp @@ -1385,7 +1385,12 @@ void PhysicsBehavior::onCollide( Object *other, const Coord3D *loc, const Coord3 else { // fall into a nonbuilding -- whatever. if we're a vehicle, quietly do a little damage. +#if RETAIL_COMPATIBLE_CRC if (obj->isKindOf(KINDOF_VEHICLE)) +#else + // TheSuperHackers @bugfix Stubbjax 28/01/2026 Prevent dead units from repeatedly dealing damage. + if (obj->isKindOf(KINDOF_VEHICLE) && !obj->isEffectivelyDead()) +#endif { TheWeaponStore->createAndFireTempWeapon(getPhysicsBehaviorModuleData()->m_vehicleCrashesIntoNonBuildingWeaponTemplate, obj, obj->getPosition()); }