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:
parent
9469256cac
commit
63a07b7ffc
@ -906,6 +906,10 @@ void cPlayer::KilledBy(TakeDamageInfo & a_TDI)
|
|||||||
}
|
}
|
||||||
GetWorld()->BroadcastChatDeath(Printf("%s %s", GetName().c_str(), DamageText.c_str()));
|
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())
|
else if (a_TDI.Attacker->IsPlayer())
|
||||||
{
|
{
|
||||||
cPlayer * Killer = (cPlayer *)a_TDI.Attacker;
|
cPlayer * Killer = (cPlayer *)a_TDI.Attacker;
|
||||||
|
Loading…
Reference in New Issue
Block a user