From 544dece3553370e120afa117c3a8563cb3312994 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Mon, 16 Feb 2026 18:56:44 +0100 Subject: [PATCH 1/2] tweak: Put several fixes that do affect gameplay behind PRESERVE_RETAIL_BEHAVIOR --- .../Code/GameEngine/Include/GameLogic/Module/HordeUpdate.h | 2 +- .../Code/GameEngine/Source/Common/RTS/ActionManager.cpp | 2 +- .../Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp | 2 +- .../GameEngine/Source/GameLogic/Object/Body/UndeadBody.cpp | 2 +- .../GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp | 2 +- .../Source/GameLogic/Object/Update/FlammableUpdate.cpp | 2 +- GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/HordeUpdate.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/HordeUpdate.h index 88891946681..221032336be 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/HordeUpdate.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/HordeUpdate.h @@ -60,7 +60,7 @@ enum HordeActionType CPP_11(: Int) HORDEACTION_COUNT, -#if RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_CRC || PRESERVE_RETAIL_BEHAVIOR HORDEACTION_DEFAULT = HORDEACTION_HORDE, #else HORDEACTION_DEFAULT = HORDEACTION_HORDE_FIXED, ///< Does not change unmodified retail game behavior, because all its horde update modules explicitly set Action = HORDE. diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/ActionManager.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/ActionManager.cpp index 21bac9f0ff3..b1ae322c139 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/ActionManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/ActionManager.cpp @@ -486,7 +486,7 @@ Bool ActionManager::canResumeConstructionOf( const Object *obj, // in the future) // Object *builder = TheGameLogic->findObjectByID( objectBeingConstructed->getBuilderID() ); -#if RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_CRC || PRESERVE_RETAIL_BEHAVIOR if( builder ) #else // TheSuperHackers @bugfix Stubbjax 18/11/2025 Allow scaffold to be immediately resumed after builder death. diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp index 941aba155af..280b9be2847 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp @@ -159,7 +159,7 @@ void PoisonedBehavior::startPoisonedEffects( const DamageInfo *damageInfo ) // We are going to take the damage dealt by the original poisoner every so often for a while. m_poisonDamageAmount = damageInfo->out.m_actualDamageDealt; -#if !RETAIL_COMPATIBLE_CRC +#if !RETAIL_COMPATIBLE_CRC && !PRESERVE_RETAIL_BEHAVIOR // TheSuperHackers @bugfix Stubbjax 03/09/2025 Allow poison damage to award xp to the poison source. m_poisonSource = damageInfo->in.m_sourceID; #endif diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/UndeadBody.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/UndeadBody.cpp index 94326258dfe..1bfda3b74cb 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/UndeadBody.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/UndeadBody.cpp @@ -81,7 +81,7 @@ void UndeadBody::attemptDamage( DamageInfo *damageInfo ) if( damageInfo->in.m_damageType != DAMAGE_UNRESISTABLE && !m_isSecondLife -#if RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_CRC || PRESERVE_RETAIL_BEHAVIOR && damageInfo->in.m_amount >= getHealth() #else // TheSuperHackers @bugfix Stubbjax 20/09/2025 Battle Buses now correctly apply damage modifiers when calculating lethal damage diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp index cf6e61f99b3..e26d2cc1511 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -1316,7 +1316,7 @@ void ChinookAIUpdate::aiDoCommand(const AICommandParms* parms) { const Real THRESH = 3.0f; const Real THRESH_SQR = THRESH*THRESH; -#if RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_CRC || PRESERVE_RETAIL_BEHAVIOR const bool allowExit = true; #else // TheSuperHackers @bugfix Stubbjax 04/11/2025 Passengers are no longer all dumped in a single frame. diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp index 174474eab41..f4082c05643 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp @@ -108,7 +108,7 @@ void FlammableUpdate::onDamage( DamageInfo *damageInfo ) m_flameDamageLimit = getFlammableUpdateModuleData()->m_flameDamageLimitData; } m_lastFlameDamageDealt = now; -#if RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_CRC || PRESERVE_RETAIL_BEHAVIOR m_flameSource = getObject()->getID(); #else // TheSuperHackers @bugfix Stubbjax 03/09/2025 Allow flame damage to award xp to the flame source. diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 9295fc519d4..d31cbdafc01 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -1172,7 +1172,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate } //------------------------------------------------------------------------------------------------- -#if RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_CRC || PRESERVE_RETAIL_BEHAVIOR void WeaponTemplate::trimOldHistoricDamage() const { UnsignedInt expirationDate = TheGameLogic->getFrame() - TheGlobalData->m_historicDamageLimit; @@ -1235,7 +1235,7 @@ static Bool is2DDistSquaredLessThan(const Coord3D& a, const Coord3D& b, Real dis } //------------------------------------------------------------------------------------------------- -#if RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_CRC || PRESERVE_RETAIL_BEHAVIOR void WeaponTemplate::processHistoricDamage(const Object* source, const Coord3D* pos) const { // From 431dac74050269620b8f21ad7a27ab614fa04e89 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Mon, 16 Feb 2026 19:03:05 +0100 Subject: [PATCH 2/2] Replicate in Generals --- .../Code/GameEngine/Include/GameLogic/Module/HordeUpdate.h | 2 +- Generals/Code/GameEngine/Source/Common/RTS/ActionManager.cpp | 2 +- .../Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp | 2 +- .../GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp | 2 +- .../Source/GameLogic/Object/Update/FlammableUpdate.cpp | 2 +- Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/HordeUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/HordeUpdate.h index 2cb66b61547..372346c2ca9 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/HordeUpdate.h +++ b/Generals/Code/GameEngine/Include/GameLogic/Module/HordeUpdate.h @@ -60,7 +60,7 @@ enum HordeActionType CPP_11(: Int) HORDEACTION_COUNT, -#if RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_CRC || PRESERVE_RETAIL_BEHAVIOR HORDEACTION_DEFAULT = HORDEACTION_HORDE, #else HORDEACTION_DEFAULT = HORDEACTION_HORDE_FIXED, ///< Does not change unmodified retail game behavior, because all its horde update modules explicitly set Action = HORDE. diff --git a/Generals/Code/GameEngine/Source/Common/RTS/ActionManager.cpp b/Generals/Code/GameEngine/Source/Common/RTS/ActionManager.cpp index 8afb0603b3b..99eec241894 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/ActionManager.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/ActionManager.cpp @@ -482,7 +482,7 @@ Bool ActionManager::canResumeConstructionOf( const Object *obj, // in the future) // Object *builder = TheGameLogic->findObjectByID( objectBeingConstructed->getBuilderID() ); -#if RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_CRC || PRESERVE_RETAIL_BEHAVIOR if( builder ) #else // TheSuperHackers @bugfix Stubbjax 18/11/2025 Allow scaffold to be immediately resumed after builder death. diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp index 94d9447cd1a..d506631a26a 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp @@ -158,7 +158,7 @@ void PoisonedBehavior::startPoisonedEffects( const DamageInfo *damageInfo ) // We are going to take the damage dealt by the original poisoner every so often for a while. m_poisonDamageAmount = damageInfo->out.m_actualDamageDealt; -#if !RETAIL_COMPATIBLE_CRC +#if !RETAIL_COMPATIBLE_CRC && !PRESERVE_RETAIL_BEHAVIOR // TheSuperHackers @bugfix Stubbjax 03/09/2025 Allow poison damage to award xp to the poison source. m_poisonSource = damageInfo->in.m_sourceID; #endif diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp index 399e6a73f04..a73da29c47d 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -1181,7 +1181,7 @@ void ChinookAIUpdate::aiDoCommand(const AICommandParms* parms) { const Real THRESH = 3.0f; const Real THRESH_SQR = THRESH*THRESH; -#if RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_CRC || PRESERVE_RETAIL_BEHAVIOR const bool allowExit = true; #else // TheSuperHackers @bugfix Stubbjax 04/11/2025 Passengers are no longer all dumped in a single frame. diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp index 97f3c571571..16020c5bd12 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp @@ -108,7 +108,7 @@ void FlammableUpdate::onDamage( DamageInfo *damageInfo ) m_flameDamageLimit = getFlammableUpdateModuleData()->m_flameDamageLimitData; } m_lastFlameDamageDealt = now; -#if RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_CRC || PRESERVE_RETAIL_BEHAVIOR m_flameSource = getObject()->getID(); #else // TheSuperHackers @bugfix Stubbjax 03/09/2025 Allow flame damage to award xp to the flame source. diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index fb0d05880b5..0bc2cadb909 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -1094,7 +1094,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate } //------------------------------------------------------------------------------------------------- -#if RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_CRC || PRESERVE_RETAIL_BEHAVIOR void WeaponTemplate::trimOldHistoricDamage() const { UnsignedInt expirationDate = TheGameLogic->getFrame() - TheGlobalData->m_historicDamageLimit; @@ -1157,7 +1157,7 @@ static Bool is2DDistSquaredLessThan(const Coord3D& a, const Coord3D& b, Real dis } //------------------------------------------------------------------------------------------------- -#if RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_CRC || PRESERVE_RETAIL_BEHAVIOR void WeaponTemplate::processHistoricDamage(const Object* source, const Coord3D* pos) const { //