Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Core/GameEngine/Include/Common/GameDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
// 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_BUG
#define RETAIL_COMPATIBLE_BUG (1) // Retain bugs present in retail Generals 1.08 and Zero Hour 1.04
#ifndef PRESERVE_RETAIL_BEHAVIOR
#define PRESERVE_RETAIL_BEHAVIOR (1) // Retain behavior present in retail Generals 1.08 and Zero Hour 1.04
#endif

#ifndef RETAIL_COMPATIBLE_CRC
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/GameEngine/Include/Common/TunnelTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,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 RETAIL_COMPATIBLE_BUG || RETAIL_COMPATIBLE_CRC
#if PRESERVE_RETAIL_BEHAVIOR || RETAIL_COMPATIBLE_CRC
void healObjects(Real frames); ///< heal all objects within the tunnel
#else
void healObjects(); ///< heal all objects within the tunnel
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/GameEngine/Source/Common/RTS/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ void Player::update()
}
}

#if !RETAIL_COMPATIBLE_BUG && !RETAIL_COMPATIBLE_CRC
#if !PRESERVE_RETAIL_BEHAVIOR && !RETAIL_COMPATIBLE_CRC
// 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();
Expand Down
4 changes: 2 additions & 2 deletions Generals/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ void TunnelTracker::destroyObject( Object *obj, void * )

// ------------------------------------------------------------------------
// heal all the objects within the tunnel system using the iterateContained function
#if RETAIL_COMPATIBLE_BUG || RETAIL_COMPATIBLE_CRC
#if PRESERVE_RETAIL_BEHAVIOR || RETAIL_COMPATIBLE_CRC
void TunnelTracker::healObjects(Real frames)
{
iterateContained(healObject, &frames, FALSE);
Expand All @@ -280,7 +280,7 @@ void TunnelTracker::healObject( Object *obj, void *frames)
{

//get the number of frames to heal
#if RETAIL_COMPATIBLE_BUG || RETAIL_COMPATIBLE_CRC
#if PRESERVE_RETAIL_BEHAVIOR || RETAIL_COMPATIBLE_CRC
Real *framesForFullHeal = (Real*)frames;
#else
UnsignedInt* framesForFullHeal = (UnsignedInt*)frames;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ Bool addDrawableToList( Drawable *draw, void *userData )
if (!pds->drawableListToFill)
return FALSE;

#if !RTS_GENERALS || !RETAIL_COMPATIBLE_BUG
#if !RTS_GENERALS || !PRESERVE_RETAIL_BEHAVIOR
// TheSuperHackers @info
// In retail, drag-selecting allows the player to select stealthed objects and objects through the
// fog. Some players exploit this bug to determine where an opponent's units are and consider this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ void ActiveBody::attemptHealing( DamageInfo *damageInfo )
//(object pointer loses scope as soon as atteptdamage's caller ends)
m_lastDamageInfo = *damageInfo;
m_lastDamageCleared = false;
#if RETAIL_COMPATIBLE_BUG
#if PRESERVE_RETAIL_BEHAVIOR
m_lastDamageTimestamp = TheGameLogic->getFrame();
#endif
m_lastHealingTimestamp = TheGameLogic->getFrame();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ UpdateSleepTime TunnelContain::update( void )
if (controllingPlayer)
{
TunnelTracker *tunnelSystem = controllingPlayer->getTunnelSystem();
#if RETAIL_COMPATIBLE_BUG || RETAIL_COMPATIBLE_CRC
#if PRESERVE_RETAIL_BEHAVIOR || RETAIL_COMPATIBLE_CRC
if (tunnelSystem)
{
const TunnelContainModuleData* modData = getTunnelContainModuleData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget
}
}

#if !RETAIL_COMPATIBLE_CRC && !RETAIL_COMPATIBLE_BUG
#if !RETAIL_COMPATIBLE_CRC && !PRESERVE_RETAIL_BEHAVIOR
ObjectID sinkID = sourceObj->getExperienceTracker()->getExperienceSink();
firstObject->getExperienceTracker()->setExperienceSink(sinkID != INVALID_ID ? sinkID : sourceObj->getID());
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@ void SpecialAbilityUpdate::triggerAbilityEffect()
if( targetMoney && objectMoney )
{
UnsignedInt cash = targetMoney->countMoney();
#if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_BUG
#if RETAIL_COMPATIBLE_CRC || PRESERVE_RETAIL_BEHAVIOR
UnsignedInt desiredAmount = 1000;
#else
UnsignedInt desiredAmount = data->m_effectValue;
Expand Down
2 changes: 1 addition & 1 deletion GeneralsMD/Code/GameEngine/Include/Common/TunnelTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,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 RETAIL_COMPATIBLE_BUG || RETAIL_COMPATIBLE_CRC
#if PRESERVE_RETAIL_BEHAVIOR || RETAIL_COMPATIBLE_CRC
void healObjects(Real frames); ///< heal all objects within the tunnel
#else
void healObjects(); ///< heal all objects within the tunnel
Expand Down
2 changes: 1 addition & 1 deletion GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ void Player::update()
}
}

#if !RETAIL_COMPATIBLE_BUG && !RETAIL_COMPATIBLE_CRC
#if !PRESERVE_RETAIL_BEHAVIOR && !RETAIL_COMPATIBLE_CRC
// 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ void TunnelTracker::destroyObject( Object *obj, void * )

// ------------------------------------------------------------------------
// heal all the objects within the tunnel system using the iterateContained function
#if RETAIL_COMPATIBLE_BUG || RETAIL_COMPATIBLE_CRC
#if PRESERVE_RETAIL_BEHAVIOR || RETAIL_COMPATIBLE_CRC
void TunnelTracker::healObjects(Real frames)
{
iterateContained(healObject, &frames, FALSE);
Expand All @@ -281,7 +281,7 @@ void TunnelTracker::healObject( Object *obj, void *frames)
{

//get the number of frames to heal
#if RETAIL_COMPATIBLE_BUG || RETAIL_COMPATIBLE_CRC
#if PRESERVE_RETAIL_BEHAVIOR || RETAIL_COMPATIBLE_CRC
Real *framesForFullHeal = (Real*)frames;
#else
UnsignedInt* framesForFullHeal = (UnsignedInt*)frames;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ Bool addDrawableToList( Drawable *draw, void *userData )
if (!pds->drawableListToFill)
return FALSE;

#if !RTS_GENERALS || !RETAIL_COMPATIBLE_BUG
#if !RTS_GENERALS || !PRESERVE_RETAIL_BEHAVIOR
if (draw->getFullyObscuredByShroud())
return FALSE;

Expand All @@ -372,7 +372,7 @@ Bool addDrawableToList( Drawable *draw, void *userData )
return FALSE;
}

#if !RTS_GENERALS && RETAIL_COMPATIBLE_BUG
#if !RTS_GENERALS && PRESERVE_RETAIL_BEHAVIOR
// TheSuperHackers @info
// In retail, hidden objects such as passengers are included here when drag-selected, which causes
// enemy selection logic to exit early (only 1 enemy unit can be selected at a time). Some players
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ void ActiveBody::attemptHealing( DamageInfo *damageInfo )
//(object pointer loses scope as soon as atteptdamage's caller ends)
m_lastDamageInfo = *damageInfo;
m_lastDamageCleared = false;
#if RETAIL_COMPATIBLE_BUG
#if PRESERVE_RETAIL_BEHAVIOR
m_lastDamageTimestamp = TheGameLogic->getFrame();
#endif
m_lastHealingTimestamp = TheGameLogic->getFrame();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ UpdateSleepTime TunnelContain::update( void )
if (controllingPlayer)
{
TunnelTracker *tunnelSystem = controllingPlayer->getTunnelSystem();
#if RETAIL_COMPATIBLE_BUG || RETAIL_COMPATIBLE_CRC
#if PRESERVE_RETAIL_BEHAVIOR || RETAIL_COMPATIBLE_CRC
if (tunnelSystem)
{
const TunnelContainModuleData* modData = getTunnelContainModuleData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget
}
}

#if !RETAIL_COMPATIBLE_CRC && !RETAIL_COMPATIBLE_BUG
#if !RETAIL_COMPATIBLE_CRC && !PRESERVE_RETAIL_BEHAVIOR
ObjectID sinkID = sourceObj->getExperienceTracker()->getExperienceSink();
firstObject->getExperienceTracker()->setExperienceSink(sinkID != INVALID_ID ? sinkID : sourceObj->getID());
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,7 @@ void SpecialAbilityUpdate::triggerAbilityEffect()
if( targetMoney && objectMoney )
{
UnsignedInt cash = targetMoney->countMoney();
#if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_BUG
#if RETAIL_COMPATIBLE_CRC || PRESERVE_RETAIL_BEHAVIOR
UnsignedInt desiredAmount = 1000;
#else
UnsignedInt desiredAmount = data->m_effectValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ Bool StealthUpdate::allowedToStealth( Object *stealthOwner ) const

if( flags & STEALTH_NOT_WHILE_TAKING_DAMAGE && self->getBodyModule()->getLastDamageTimestamp() >= now - 1 )
{
#if RETAIL_COMPATIBLE_BUG
#if PRESERVE_RETAIL_BEHAVIOR
//Only if it's not healing damage.
if( self->getBodyModule()->getLastDamageInfo()->in.m_damageType != DAMAGE_HEALING )
#endif
Expand Down
Loading