summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-01-16 10:56:19 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-01-16 10:56:19 +0100
commit5ca2f4fd0c3f520f9ce8ef2afaef6c283e5856c7 (patch)
tree6974a1777b1d819150f1a69e31f764e2ae2cac48
parentMerge pull request #2869 from LogicParrot/typos (diff)
parentFix fall damage crash when tamed wolves neabry (diff)
downloadcuberite-5ca2f4fd0c3f520f9ce8ef2afaef6c283e5856c7.tar
cuberite-5ca2f4fd0c3f520f9ce8ef2afaef6c283e5856c7.tar.gz
cuberite-5ca2f4fd0c3f520f9ce8ef2afaef6c283e5856c7.tar.bz2
cuberite-5ca2f4fd0c3f520f9ce8ef2afaef6c283e5856c7.tar.lz
cuberite-5ca2f4fd0c3f520f9ce8ef2afaef6c283e5856c7.tar.xz
cuberite-5ca2f4fd0c3f520f9ce8ef2afaef6c283e5856c7.tar.zst
cuberite-5ca2f4fd0c3f520f9ce8ef2afaef6c283e5856c7.zip
-rw-r--r--src/Entities/Player.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 766161703..c88a78a41 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -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: