File tree Expand file tree Collapse file tree
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -310,15 +310,17 @@ Bool StealthUpdate::allowedToStealth( Object *stealthOwner ) const
310310 return FALSE ;
311311 }
312312
313- if ( flags & STEALTH_NOT_WHILE_TAKING_DAMAGE && self->getBodyModule ()->getLastDamageTimestamp () >= now - 1 )
313+ BodyModuleInterface *body = self->getBodyModule ();
314+ if ( flags & STEALTH_NOT_WHILE_TAKING_DAMAGE && body && body->getLastDamageTimestamp () >= now - 1 )
314315 {
315316#if RETAIL_COMPATIBLE_CRC || PRESERVE_STRUCTURE_STEALTH_DURING_REPAIR
316317 // Only if it's not healing damage.
317- if ( self->getBodyModule ()->getLastDamageInfo ()->in .m_damageType != DAMAGE_HEALING )
318+ const DamageInfo *lastDamageInfo = body->getLastDamageInfo ();
319+ if ( lastDamageInfo && lastDamageInfo->in .m_damageType != DAMAGE_HEALING )
318320#endif
319321 {
320322 // Can't stealth if we just took damage in the last frame or two.
321- if ( self-> getBodyModule () ->getLastDamageTimestamp () != 0xffffffff )
323+ if ( body ->getLastDamageTimestamp () != 0xffffffff )
322324 {
323325 // But it's initialized to 0xffffffff so we don't think we took damage on the first frame.
324326 return FALSE ;
You can’t perform that action at this time.
0 commit comments