Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,16 @@ void OpenContain::addOrRemoveObjFromWorld(Object* obj, Bool add)
//-------------------------------------------------------------------------------------------------
void OpenContain::addToContain( Object *rider )
{

#if RETAIL_COMPATIBLE_CRC
Comment thread
Caball009 marked this conversation as resolved.
Outdated
Comment thread
Caball009 marked this conversation as resolved.
Outdated
// sanity
if( rider == nullptr )
return;
#else
// TheSuperHackers @bugfix Stubbjax 06/02/2026 Always ensure interacting objects are alive.
// This prevents undefined behaviour if a unit dies and enters a container on the same frame.
Comment thread
Caball009 marked this conversation as resolved.
Outdated
if (rider == nullptr || (rider->isEffectivelyDead() && !rider->getBodyModule()->isIndestructible()) || getObject()->isEffectivelyDead())
return;
#endif
Comment thread
Caball009 marked this conversation as resolved.
Outdated

#if defined(RTS_DEBUG)
if( !isValidContainerFor( rider, false ) )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ void OpenContain::addOrRemoveObjFromWorld(Object* obj, Bool add)
//-------------------------------------------------------------------------------------------------
void OpenContain::addToContain( Object *rider )
{
#if RETAIL_COMPATIBLE_CRC
if( getObject()->checkAndDetonateBoobyTrap(rider) )
{
// Whoops, I was mined. Cancel if I (or they) am now dead.
Expand All @@ -292,6 +293,14 @@ void OpenContain::addToContain( Object *rider )
// sanity
if( rider == nullptr )
Comment thread
Caball009 marked this conversation as resolved.
return;
#else
getObject()->checkAndDetonateBoobyTrap(rider);

Comment thread
Caball009 marked this conversation as resolved.
// TheSuperHackers @bugfix Stubbjax 06/02/2026 Always ensure interacting objects are alive.
// This prevents undefined behaviour if a unit dies and enters a container on the same frame.
if (rider == nullptr || (rider->isEffectivelyDead() && !rider->getBodyModule()->isIndestructible()) || getObject()->isEffectivelyDead())
return;
Comment thread
Caball009 marked this conversation as resolved.
#endif

Drawable *riderDraw = rider->getDrawable();
Bool wasSelected = FALSE;
Expand Down
Loading