From d541e47e69d38ac2dcdfd0e63e62452444620850 Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Mon, 18 May 2026 00:04:44 +0200 Subject: [PATCH 1/3] Fixed retail behavior macros. --- Core/GameEngine/Include/Common/GameDefines.h | 32 +++++++++++--------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/Core/GameEngine/Include/Common/GameDefines.h b/Core/GameEngine/Include/Common/GameDefines.h index 1bf9f096fcf..9e3c01261f4 100644 --- a/Core/GameEngine/Include/Common/GameDefines.h +++ b/Core/GameEngine/Include/Common/GameDefines.h @@ -23,8 +23,20 @@ // Note: Retail compatibility must not be broken before this project officially does. // Use RETAIL_COMPATIBLE_CRC and RETAIL_COMPATIBLE_XFER_SAVE to guard breaking changes. +#ifndef RETAIL_COMPATIBLE_CRC +#define RETAIL_COMPATIBLE_CRC (1) // Game is expected to be CRC compatible with retail Generals 1.08, Zero Hour 1.04 +#endif + +#ifndef RETAIL_COMPATIBLE_XFER_SAVE +#define RETAIL_COMPATIBLE_XFER_SAVE (1) // Game is expected to be Xfer Save compatible with retail Generals 1.08, Zero Hour 1.04 +#endif + +#if RETAIL_COMPATIBLE_CRC || !defined(PRESERVE_RETAIL_BEHAVIOR) +#define PRESERVE_RETAIL_BEHAVIOR (1) // Retain specific behavior present in retail Generals 1.08 and Zero Hour 1.04. Should only be used in this file. +#endif + #ifndef PRESERVE_BUILDING_RESUMPTION_DELAY -#define PRESERVE_BUILDING_RESUMPTION_DELAY (0) // The fix for this unfavorable behavior was approved by the Game Design Committee. +#define PRESERVE_BUILDING_RESUMPTION_DELAY PRESERVE_RETAIL_BEHAVIOR // The fix for this unfavorable behavior was approved by the Game Design Committee. #endif #ifndef PRESERVE_CHINOOK_PASSENGER_DUMPING @@ -36,11 +48,11 @@ #endif #ifndef PRESERVE_MULTI_CRATE_PICKUP -#define PRESERVE_MULTI_CRATE_PICKUP (0) // The fix for this unfavorable behavior was approved by the Game Design Committee. +#define PRESERVE_MULTI_CRATE_PICKUP PRESERVE_RETAIL_BEHAVIOR // The fix for this unfavorable behavior was approved by the Game Design Committee. #endif #ifndef PRESERVE_NO_XP_FROM_FLAME_KILLS -#define PRESERVE_NO_XP_FROM_FLAME_KILLS (0) // The fix for this unfavorable behavior was approved by the Game Design Committee. +#define PRESERVE_NO_XP_FROM_FLAME_KILLS PRESERVE_RETAIL_BEHAVIOR // The fix for this unfavorable behavior was approved by the Game Design Committee. #endif #ifndef PRESERVE_NO_XP_FROM_OCL_KILLS @@ -68,7 +80,7 @@ #endif #ifndef PRESERVE_STRUCTURE_STEALTH_DURING_REPAIR -#define PRESERVE_STRUCTURE_STEALTH_DURING_REPAIR (0) // The fix for this unfavorable behavior was approved by the Game Design Committee. +#define PRESERVE_STRUCTURE_STEALTH_DURING_REPAIR PRESERVE_RETAIL_BEHAVIOR // The fix for this unfavorable behavior was approved by the Game Design Committee. #endif #ifndef PRESERVE_TUNNEL_HEAL_STACKING @@ -76,21 +88,13 @@ #endif #ifndef PRESERVE_UNRELIABLE_FIRESTORMS -#define PRESERVE_UNRELIABLE_FIRESTORMS (0) // The fix for this unfavorable behavior was approved by the Game Design Committee. +#define PRESERVE_UNRELIABLE_FIRESTORMS PRESERVE_RETAIL_BEHAVIOR // The fix for this unfavorable behavior was approved by the Game Design Committee. #endif #ifndef PRESERVE_RETAIL_SCRIPTED_CAMERA #define PRESERVE_RETAIL_SCRIPTED_CAMERA (1) // Retain scripted camera behavior present in retail Generals 1.08 and Zero Hour 1.04 #endif -#ifndef RETAIL_COMPATIBLE_CRC -#define RETAIL_COMPATIBLE_CRC (1) // Game is expected to be CRC compatible with retail Generals 1.08, Zero Hour 1.04 -#endif - -#ifndef RETAIL_COMPATIBLE_XFER_SAVE -#define RETAIL_COMPATIBLE_XFER_SAVE (1) // Game is expected to be Xfer Save compatible with retail Generals 1.08, Zero Hour 1.04 -#endif - // This is here to easily toggle between the retail compatible with fixed pathfinding fallback and pure fixed pathfinding mode #ifndef RETAIL_COMPATIBLE_PATHFINDING #define RETAIL_COMPATIBLE_PATHFINDING (1) @@ -123,7 +127,7 @@ #endif #ifndef ALLOW_MONEY_PER_MINUTE_FOR_PLAYER -#define ALLOW_MONEY_PER_MINUTE_FOR_PLAYER (0) // When enabled, a money-per-minute stat is calculated and displayed in-game +#define ALLOW_MONEY_PER_MINUTE_FOR_PLAYER PRESERVE_RETAIL_BEHAVIOR // When enabled, a money-per-minute stat is calculated and displayed in-game #endif // Previously the configurable shroud sat behind #if defined(RTS_DEBUG) From ce7abe511ca98ff1bddb99574276877c9546fc46 Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Mon, 18 May 2026 00:05:26 +0200 Subject: [PATCH 2/3] Changed macro order. --- GeneralsMD/Code/GameEngine/Include/Common/TunnelTracker.h | 2 +- GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp | 2 +- .../Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp | 4 ++-- .../Source/GameLogic/Object/Contain/TunnelContain.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Include/Common/TunnelTracker.h b/GeneralsMD/Code/GameEngine/Include/Common/TunnelTracker.h index b1e3f5bf492..b044ebc00cd 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/TunnelTracker.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/TunnelTracker.h @@ -60,7 +60,7 @@ class TunnelTracker : public MemoryPoolObject, static void destroyObject( Object *obj, void *userData ); ///< Callback for Iterate Contained system static void healObject( Object *obj, void *frames ); ///< Callback for Iterate Contained system -#if PRESERVE_TUNNEL_HEAL_STACKING || RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_CRC || PRESERVE_TUNNEL_HEAL_STACKING void healObjects(Real frames); ///< heal all objects within the tunnel #else void healObjects(); ///< heal all objects within the tunnel diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp index a9a53e3a006..d8b99ac9b4f 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp @@ -716,7 +716,7 @@ void Player::update() } } -#if !PRESERVE_TUNNEL_HEAL_STACKING && !RETAIL_COMPATIBLE_CRC +#if !RETAIL_COMPATIBLE_CRC && !PRESERVE_TUNNEL_HEAL_STACKING // TheSuperHackers @bugfix Stubbjax 26/09/2025 The Tunnel System now heals // all units once per frame instead of once per frame per Tunnel Network. TunnelTracker* tunnelSystem = getTunnelSystem(); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp index 5e1de31615e..114c70088f3 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp @@ -278,7 +278,7 @@ void TunnelTracker::destroyObject( Object *obj, void * ) // ------------------------------------------------------------------------ // heal all the objects within the tunnel system using the iterateContained function -#if PRESERVE_TUNNEL_HEAL_STACKING || RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_CRC || PRESERVE_TUNNEL_HEAL_STACKING void TunnelTracker::healObjects(Real frames) { iterateContained(healObject, &frames, FALSE); @@ -302,7 +302,7 @@ void TunnelTracker::healObject( Object *obj, void *frames) { //get the number of frames to heal -#if PRESERVE_TUNNEL_HEAL_STACKING || RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_CRC || PRESERVE_TUNNEL_HEAL_STACKING Real *framesForFullHeal = (Real*)frames; #else UnsignedInt* framesForFullHeal = (UnsignedInt*)frames; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TunnelContain.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TunnelContain.cpp index aa6a5f1aa5d..b8b3115beea 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TunnelContain.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TunnelContain.cpp @@ -549,7 +549,7 @@ UpdateSleepTime TunnelContain::update() if (controllingPlayer) { TunnelTracker *tunnelSystem = controllingPlayer->getTunnelSystem(); -#if PRESERVE_TUNNEL_HEAL_STACKING || RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_CRC || PRESERVE_TUNNEL_HEAL_STACKING if (tunnelSystem) { const TunnelContainModuleData* modData = getTunnelContainModuleData(); From d48d2c99771da30c85251cf9d70872a67492da7b Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Mon, 18 May 2026 19:29:43 +0200 Subject: [PATCH 3/3] Changed macro expressions. --- GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp | 2 +- .../Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp | 2 +- .../GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp index d8b99ac9b4f..cfa31bcc99c 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp @@ -716,7 +716,7 @@ void Player::update() } } -#if !RETAIL_COMPATIBLE_CRC && !PRESERVE_TUNNEL_HEAL_STACKING +#if !(RETAIL_COMPATIBLE_CRC || PRESERVE_TUNNEL_HEAL_STACKING) // TheSuperHackers @bugfix Stubbjax 26/09/2025 The Tunnel System now heals // all units once per frame instead of once per frame per Tunnel Network. TunnelTracker* tunnelSystem = getTunnelSystem(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp index c593952333a..1cadfe55df4 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 && !PRESERVE_NO_XP_FROM_POISON_KILLS +#if !(RETAIL_COMPATIBLE_CRC || PRESERVE_NO_XP_FROM_POISON_KILLS) // 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/ObjectCreationList.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp index 892c1f120ab..b77ede9b68e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp @@ -1428,7 +1428,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget } } -#if !RETAIL_COMPATIBLE_CRC && !PRESERVE_NO_XP_FROM_OCL_KILLS +#if !(RETAIL_COMPATIBLE_CRC || PRESERVE_NO_XP_FROM_OCL_KILLS) ObjectID sinkID = sourceObj->getExperienceTracker()->getExperienceSink(); firstObject->getExperienceTracker()->setExperienceSink(sinkID != INVALID_ID ? sinkID : sourceObj->getID()); #endif