summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-01-16 10:29:11 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-01-16 10:29:11 +0100
commit0601adba25ad9d8f77450b75743255378b4a7b99 (patch)
tree9df5ef1487f304f0bc535e02d057787fc840d1b3 /src/Entities
parentcompile.sh - 70 columns print limit (diff)
downloadcuberite-0601adba25ad9d8f77450b75743255378b4a7b99.tar
cuberite-0601adba25ad9d8f77450b75743255378b4a7b99.tar.gz
cuberite-0601adba25ad9d8f77450b75743255378b4a7b99.tar.bz2
cuberite-0601adba25ad9d8f77450b75743255378b4a7b99.tar.lz
cuberite-0601adba25ad9d8f77450b75743255378b4a7b99.tar.xz
cuberite-0601adba25ad9d8f77450b75743255378b4a7b99.tar.zst
cuberite-0601adba25ad9d8f77450b75743255378b4a7b99.zip
Diffstat (limited to '')
-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 c5a1e0f95..270b09c24 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -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: