1
0
Fork 0

Fixed potential crash in Player.cpp

Fixes CID 71780
If ShouldBroadcastDeathMessages is false the pointer would fall through to a check agaist it being a player
This commit is contained in:
Tycho 2014-08-10 20:47:16 +01:00
parent 9469256cac
commit 63a07b7ffc
1 changed files with 4 additions and 0 deletions

View File

@ -906,6 +906,10 @@ void cPlayer::KilledBy(TakeDamageInfo & a_TDI)
}
GetWorld()->BroadcastChatDeath(Printf("%s %s", GetName().c_str(), DamageText.c_str()));
}
else if (a_TDI.Attacker == NULL) // && !m_World->ShouldBroadcastDeathMessages() by fallthrough
{
// no-op
}
else if (a_TDI.Attacker->IsPlayer())
{
cPlayer * Killer = (cPlayer *)a_TDI.Attacker;