Skip to content

Commit f0dfc9d

Browse files
committed
tweak: Apply fix in retail-compatible path
1 parent fda1f98 commit f0dfc9d

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,16 +273,15 @@ void OpenContain::addOrRemoveObjFromWorld(Object* obj, Bool add)
273273
//-------------------------------------------------------------------------------------------------
274274
void OpenContain::addToContain( Object *rider )
275275
{
276-
#if RETAIL_COMPATIBLE_CRC
276+
277277
// sanity
278278
if( rider == nullptr )
279279
return;
280-
#else
280+
281281
// TheSuperHackers @bugfix Stubbjax 06/02/2026 Always ensure interacting objects are alive.
282282
// This prevents undefined behaviour if a unit dies and enters a container on the same frame.
283-
if (rider == nullptr || rider->isDestroyed() || getObject()->isDestroyed())
283+
if (rider->isDestroyed() || getObject()->isDestroyed())
284284
return;
285-
#endif
286285

287286
#if defined(RTS_DEBUG)
288287
if( !isValidContainerFor( rider, false ) )

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ void OpenContain::addOrRemoveObjFromWorld(Object* obj, Bool add)
280280
//-------------------------------------------------------------------------------------------------
281281
void OpenContain::addToContain( Object *rider )
282282
{
283-
#if RETAIL_COMPATIBLE_CRC
284283
if( getObject()->checkAndDetonateBoobyTrap(rider) )
285284
{
286285
// Whoops, I was mined. Cancel if I (or they) am now dead.
@@ -293,14 +292,11 @@ void OpenContain::addToContain( Object *rider )
293292
// sanity
294293
if( rider == nullptr )
295294
return;
296-
#else
297-
getObject()->checkAndDetonateBoobyTrap(rider);
298295

299296
// TheSuperHackers @bugfix Stubbjax 06/02/2026 Always ensure interacting objects are alive.
300297
// This prevents undefined behaviour if a unit dies and enters a container on the same frame.
301-
if (rider == nullptr || rider->isDestroyed() || getObject()->isDestroyed())
298+
if (rider->isDestroyed() || getObject()->isDestroyed())
302299
return;
303-
#endif
304300

305301
Drawable *riderDraw = rider->getDrawable();
306302
Bool wasSelected = FALSE;

0 commit comments

Comments
 (0)