Skip to content

Commit 9706d30

Browse files
authored
refactor: Rename RETAIL_COMPATIBLE_BUG macro to PRESERVE_RETAIL_BEHAVIOR (#1877)
1 parent a1be619 commit 9706d30

File tree

18 files changed

+22
-22
lines changed

18 files changed

+22
-22
lines changed

Core/GameEngine/Include/Common/GameDefines.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
// Note: Retail compatibility must not be broken before this project officially does.
2424
// Use RETAIL_COMPATIBLE_CRC and RETAIL_COMPATIBLE_XFER_SAVE to guard breaking changes.
2525

26-
#ifndef RETAIL_COMPATIBLE_BUG
27-
#define RETAIL_COMPATIBLE_BUG (1) // Retain bugs present in retail Generals 1.08 and Zero Hour 1.04
26+
#ifndef PRESERVE_RETAIL_BEHAVIOR
27+
#define PRESERVE_RETAIL_BEHAVIOR (1) // Retain behavior present in retail Generals 1.08 and Zero Hour 1.04
2828
#endif
2929

3030
#ifndef RETAIL_COMPATIBLE_CRC

Generals/Code/GameEngine/Include/Common/TunnelTracker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class TunnelTracker : public MemoryPoolObject,
5959
static void destroyObject( Object *obj, void *userData ); ///< Callback for Iterate Contained system
6060
static void healObject( Object *obj, void *frames ); ///< Callback for Iterate Contained system
6161

62-
#if RETAIL_COMPATIBLE_BUG || RETAIL_COMPATIBLE_CRC
62+
#if PRESERVE_RETAIL_BEHAVIOR || RETAIL_COMPATIBLE_CRC
6363
void healObjects(Real frames); ///< heal all objects within the tunnel
6464
#else
6565
void healObjects(); ///< heal all objects within the tunnel

Generals/Code/GameEngine/Source/Common/RTS/Player.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ void Player::update()
677677
}
678678
}
679679

680-
#if !RETAIL_COMPATIBLE_BUG && !RETAIL_COMPATIBLE_CRC
680+
#if !PRESERVE_RETAIL_BEHAVIOR && !RETAIL_COMPATIBLE_CRC
681681
// TheSuperHackers @bugfix Stubbjax 26/09/2025 The Tunnel System now heals
682682
// all units once per frame instead of once per frame per Tunnel Network.
683683
TunnelTracker* tunnelSystem = getTunnelSystem();

Generals/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ void TunnelTracker::destroyObject( Object *obj, void * )
256256

257257
// ------------------------------------------------------------------------
258258
// heal all the objects within the tunnel system using the iterateContained function
259-
#if RETAIL_COMPATIBLE_BUG || RETAIL_COMPATIBLE_CRC
259+
#if PRESERVE_RETAIL_BEHAVIOR || RETAIL_COMPATIBLE_CRC
260260
void TunnelTracker::healObjects(Real frames)
261261
{
262262
iterateContained(healObject, &frames, FALSE);
@@ -280,7 +280,7 @@ void TunnelTracker::healObject( Object *obj, void *frames)
280280
{
281281

282282
//get the number of frames to heal
283-
#if RETAIL_COMPATIBLE_BUG || RETAIL_COMPATIBLE_CRC
283+
#if PRESERVE_RETAIL_BEHAVIOR || RETAIL_COMPATIBLE_CRC
284284
Real *framesForFullHeal = (Real*)frames;
285285
#else
286286
UnsignedInt* framesForFullHeal = (UnsignedInt*)frames;

Generals/Code/GameEngine/Source/GameClient/SelectionInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ Bool addDrawableToList( Drawable *draw, void *userData )
347347
if (!pds->drawableListToFill)
348348
return FALSE;
349349

350-
#if !RTS_GENERALS || !RETAIL_COMPATIBLE_BUG
350+
#if !RTS_GENERALS || !PRESERVE_RETAIL_BEHAVIOR
351351
// TheSuperHackers @info
352352
// In retail, drag-selecting allows the player to select stealthed objects and objects through the
353353
// fog. Some players exploit this bug to determine where an opponent's units are and consider this

Generals/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ void ActiveBody::attemptHealing( DamageInfo *damageInfo )
593593
//(object pointer loses scope as soon as atteptdamage's caller ends)
594594
m_lastDamageInfo = *damageInfo;
595595
m_lastDamageCleared = false;
596-
#if RETAIL_COMPATIBLE_BUG
596+
#if PRESERVE_RETAIL_BEHAVIOR
597597
m_lastDamageTimestamp = TheGameLogic->getFrame();
598598
#endif
599599
m_lastHealingTimestamp = TheGameLogic->getFrame();

Generals/Code/GameEngine/Source/GameLogic/Object/Contain/TunnelContain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ UpdateSleepTime TunnelContain::update( void )
403403
if (controllingPlayer)
404404
{
405405
TunnelTracker *tunnelSystem = controllingPlayer->getTunnelSystem();
406-
#if RETAIL_COMPATIBLE_BUG || RETAIL_COMPATIBLE_CRC
406+
#if PRESERVE_RETAIL_BEHAVIOR || RETAIL_COMPATIBLE_CRC
407407
if (tunnelSystem)
408408
{
409409
const TunnelContainModuleData* modData = getTunnelContainModuleData();

Generals/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget
13331333
}
13341334
}
13351335

1336-
#if !RETAIL_COMPATIBLE_CRC && !RETAIL_COMPATIBLE_BUG
1336+
#if !RETAIL_COMPATIBLE_CRC && !PRESERVE_RETAIL_BEHAVIOR
13371337
ObjectID sinkID = sourceObj->getExperienceTracker()->getExperienceSink();
13381338
firstObject->getExperienceTracker()->setExperienceSink(sinkID != INVALID_ID ? sinkID : sourceObj->getID());
13391339
#endif

Generals/Code/GameEngine/Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ void SpecialAbilityUpdate::triggerAbilityEffect()
13411341
if( targetMoney && objectMoney )
13421342
{
13431343
UnsignedInt cash = targetMoney->countMoney();
1344-
#if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_BUG
1344+
#if RETAIL_COMPATIBLE_CRC || PRESERVE_RETAIL_BEHAVIOR
13451345
UnsignedInt desiredAmount = 1000;
13461346
#else
13471347
UnsignedInt desiredAmount = data->m_effectValue;

GeneralsMD/Code/GameEngine/Include/Common/TunnelTracker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class TunnelTracker : public MemoryPoolObject,
5959
static void destroyObject( Object *obj, void *userData ); ///< Callback for Iterate Contained system
6060
static void healObject( Object *obj, void *frames ); ///< Callback for Iterate Contained system
6161

62-
#if RETAIL_COMPATIBLE_BUG || RETAIL_COMPATIBLE_CRC
62+
#if PRESERVE_RETAIL_BEHAVIOR || RETAIL_COMPATIBLE_CRC
6363
void healObjects(Real frames); ///< heal all objects within the tunnel
6464
#else
6565
void healObjects(); ///< heal all objects within the tunnel

0 commit comments

Comments
 (0)