1
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

View File

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