Skip to content

Commit 44083eb

Browse files
authored
bugfix(cratecollide): Prevent crates from being collected multiple times in a single frame (TheSuperHackers#2279)
1 parent cfbdb3f commit 44083eb

File tree

2 files changed

+12
-0
lines changed
  • GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide
  • Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide

2 files changed

+12
-0
lines changed

Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/CrateCollide.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ Bool CrateCollide::isValidToExecute( const Object *other ) const
162162
if( getObject()->isAboveTerrain() && !validBuildingAttempt )
163163
return FALSE;
164164

165+
// TheSuperHackers @bugfix Stubbjax 09/02/2026 Prevent the crate from being collected multiple times in a single frame.
166+
#if !RETAIL_COMPATIBLE_CRC
167+
if (getObject()->isDestroyed())
168+
return FALSE;
169+
#endif
170+
165171
if( md->m_isForbidOwnerPlayer && (getObject()->getControllingPlayer() == other->getControllingPlayer()) )
166172
return FALSE; // Design has decreed this to not be picked up by the dead guy's team.
167173

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/CrateCollide.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ Bool CrateCollide::isValidToExecute( const Object *other ) const
165165
if( getObject()->isAboveTerrain() && !validBuildingAttempt )
166166
return FALSE;
167167

168+
// TheSuperHackers @bugfix Stubbjax 09/02/2026 Prevent the crate from being collected multiple times in a single frame.
169+
#if !RETAIL_COMPATIBLE_CRC
170+
if (getObject()->isDestroyed())
171+
return FALSE;
172+
#endif
173+
168174
if( md->m_isForbidOwnerPlayer && (getObject()->getControllingPlayer() == other->getControllingPlayer()) )
169175
return FALSE; // Design has decreed this to not be picked up by the dead guy's team.
170176

0 commit comments

Comments
 (0)