1
0
Fork 0

Fix fall damage crash when tamed wolves neabry

This commit is contained in:
LogicParrot 2016-01-16 11:29:11 +02:00
parent 0affb47c7d
commit 0601adba25
1 changed files with 5 additions and 1 deletions

View File

@ -852,7 +852,10 @@ bool cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI)
AddFoodExhaustion(0.3f);
SendHealth();
NotifyFriendlyWolves(a_TDI.Attacker);
if (a_TDI.Attacker != nullptr)
{
NotifyFriendlyWolves(a_TDI.Attacker);
}
m_Stats.AddValue(statDamageTaken, FloorC<StatValue>(a_TDI.FinalDamage * 10 + 0.5));
return true;
}
@ -865,6 +868,7 @@ bool cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI)
void cPlayer::NotifyFriendlyWolves(cEntity * a_Opponent)
{
ASSERT(a_Opponent != nullptr);
class LookForWolves : public cEntityCallback
{
public: