Fixed a npc_zombie crash caused by inflictor-less crush damage

This commit is contained in:
Blixibon 2021-01-24 22:32:22 -06:00
parent f484653f41
commit 763c836d45

View File

@ -908,7 +908,7 @@ bool CZombie::IsSquashed( const CTakeDamageInfo &info )
return false;
}
if( info.GetDamageType() & DMG_CRUSH )
if( info.GetDamageType() & DMG_CRUSH && info.GetInflictor() ) // Mapbase - Fixes a crash with inflictor-less crush damage
{
IPhysicsObject *pCrusher = info.GetInflictor()->VPhysicsGetObject();
if( pCrusher && pCrusher->GetMass() >= ZOMBIE_SQUASH_MASS && info.GetInflictor()->WorldSpaceCenter().z > EyePosition().z )