1
0
Fork 0

Merge pull request #2875 from LogicParrot/fallDamage

Fix fall damage crash when tamed wolves neabry
This commit is contained in:
LogicParrot 2016-01-16 11:56:19 +02:00
commit 5ca2f4fd0c
1 changed files with 5 additions and 1 deletions

View File

@ -854,7 +854,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;
}
@ -867,6 +870,7 @@ bool cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI)
void cPlayer::NotifyFriendlyWolves(cEntity * a_Opponent)
{
ASSERT(a_Opponent != nullptr);
class LookForWolves : public cEntityCallback
{
public: