summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-01-16 13:16:47 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-01-16 15:37:37 +0100
commit8c12227687454abe5bdd0b8796f84f15fd3817d8 (patch)
tree6ebcb9d63146b2626311220b69b0c311e2a74c94 /src/Entities/Player.cpp
parentMerge pull request #2875 from LogicParrot/fallDamage (diff)
downloadcuberite-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 'src/Entities/Player.cpp')
-rw-r--r--src/Entities/Player.cpp11
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)
{