Skip to content

Commit cf0daed

Browse files
committed
Addressed feedback.
1 parent 0ad565e commit cf0daed

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -241,23 +241,18 @@ void OpenContain::addOrRemoveObjFromWorld(Object* obj, Bool add)
241241
}
242242
else
243243
{
244+
DEBUG_ASSERTCRASH(!getObject()->isEffectivelyDead() && !getObject()->isDestroyed(),
245+
("object shouldn't become an occupant of a dead or destroyed container object"));
246+
244247
// remove object from its group (if any)
245248
obj->leaveGroup();
246249

247250
// remove rider from partition manager
248251
ThePartitionManager->unRegisterObject( obj );
249252

250-
if (Drawable* drawable = obj->getDrawable())
251-
{
252-
#if RTS_DEBUG
253-
// TheSuperHackers @tweak This shouldn't happen but don't make the occupant invisible if it does.
254-
if (!(getObject()->isEffectivelyDead() || getObject()->isDestroyed()))
255-
#endif
256-
{
257-
// hide the drawable associated with rider
258-
drawable->setDrawableHidden(true);
259-
}
260-
}
253+
// hide the drawable associated with rider
254+
if( obj->getDrawable() )
255+
obj->getDrawable()->setDrawableHidden( true );
261256

262257
// remove object from pathfind map
263258
TheAI->pathfinder()->removeObjectFromPathfindMap( obj );

0 commit comments

Comments
 (0)