Skip to content

Commit 7309626

Browse files
committed
tweak: Entering destroyed containers is already safe
1 parent f0dfc9d commit 7309626

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ void OpenContain::addToContain( Object *rider )
280280

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->isDestroyed() || getObject()->isDestroyed())
283+
if (rider->isDestroyed())
284284
return;
285285

286286
#if defined(RTS_DEBUG)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ void OpenContain::addToContain( Object *rider )
295295

296296
// TheSuperHackers @bugfix Stubbjax 06/02/2026 Always ensure interacting objects are alive.
297297
// This prevents undefined behaviour if a unit dies and enters a container on the same frame.
298-
if (rider->isDestroyed() || getObject()->isDestroyed())
298+
if (rider->isDestroyed())
299299
return;
300300

301301
Drawable *riderDraw = rider->getDrawable();

0 commit comments

Comments
 (0)