diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-01-16 13:16:47 +0100 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-01-16 15:37:37 +0100 |
commit | 8c12227687454abe5bdd0b8796f84f15fd3817d8 (patch) | |
tree | 6ebcb9d63146b2626311220b69b0c311e2a74c94 /src/Entities/Player.cpp | |
parent | Merge pull request #2875 from LogicParrot/fallDamage (diff) | |
download | cuberite-8c12227687454abe5bdd0b8796f84f15fd3817d8.tar cuberite-8c12227687454abe5bdd0b8796f84f15fd3817d8.tar.gz cuberite-8c12227687454abe5bdd0b8796f84f15fd3817d8.tar.bz2 cuberite-8c12227687454abe5bdd0b8796f84f15fd3817d8.tar.lz cuberite-8c12227687454abe5bdd0b8796f84f15fd3817d8.tar.xz cuberite-8c12227687454abe5bdd0b8796f84f15fd3817d8.tar.zst cuberite-8c12227687454abe5bdd0b8796f84f15fd3817d8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/Player.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index c88a78a41..c5e6ef626 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -856,7 +856,10 @@ bool cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI) if (a_TDI.Attacker != nullptr) { - NotifyFriendlyWolves(a_TDI.Attacker); + if (a_TDI.Attacker->IsPawn()) + { + NotifyFriendlyWolves(static_cast<cPawn*>(a_TDI.Attacker)); + } } m_Stats.AddValue(statDamageTaken, FloorC<StatValue>(a_TDI.FinalDamage * 10 + 0.5)); return true; @@ -868,16 +871,16 @@ bool cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI) -void cPlayer::NotifyFriendlyWolves(cEntity * a_Opponent) +void cPlayer::NotifyFriendlyWolves(cPawn * a_Opponent) { ASSERT(a_Opponent != nullptr); class LookForWolves : public cEntityCallback { public: cPlayer * m_Player; - cEntity * m_Attacker; + cPawn * m_Attacker; - LookForWolves(cPlayer * a_Me, cEntity * a_MyAttacker) : + LookForWolves(cPlayer * a_Me, cPawn * a_MyAttacker) : m_Player(a_Me), m_Attacker(a_MyAttacker) { |