diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-01-22 19:55:46 +0100 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-01-22 20:16:27 +0100 |
commit | 439b3304f4c82448b0e1585f8641503691212cac (patch) | |
tree | 706035da78a49c971f6d3bf3d812582581ce93a4 /src/Entities/ProjectileEntity.cpp | |
parent | Merge pull request #2894 from LogicParrot/spider (diff) | |
download | cuberite-439b3304f4c82448b0e1585f8641503691212cac.tar cuberite-439b3304f4c82448b0e1585f8641503691212cac.tar.gz cuberite-439b3304f4c82448b0e1585f8641503691212cac.tar.bz2 cuberite-439b3304f4c82448b0e1585f8641503691212cac.tar.lz cuberite-439b3304f4c82448b0e1585f8641503691212cac.tar.xz cuberite-439b3304f4c82448b0e1585f8641503691212cac.tar.zst cuberite-439b3304f4c82448b0e1585f8641503691212cac.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/ProjectileEntity.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp index bb08f38d9..72dccbfb4 100644 --- a/src/Entities/ProjectileEntity.cpp +++ b/src/Entities/ProjectileEntity.cpp @@ -314,26 +314,24 @@ void cProjectileEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_ void cProjectileEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) { - if (a_EntityHit.IsPawn() && (GetCreatorName() != "")) // If we're hitting a mob or a player and we were created by a player - { + UNUSED(a_HitPos); + // If we were created by a player and we hit a pawn, notify attacking player's wolves + if (a_EntityHit.IsPawn() && (GetCreatorName() != "")) + { class cNotifyWolves : public cEntityCallback { public: cPawn * m_EntityHit; - cNotifyWolves(cPawn * a_Entity) : - m_EntityHit(a_Entity) - { - } - - virtual bool Item(cEntity * a_Player) override + virtual bool Item(cEntity * a_Hitter) override { - static_cast<cPlayer*>(a_Player)->NotifyFriendlyWolves(m_EntityHit); + static_cast<cPlayer*>(a_Hitter)->NotifyNearbyWolves(m_EntityHit, true); return true; } - } Callback(static_cast<cPawn*>(&a_EntityHit)); + } Callback; + Callback.m_EntityHit = static_cast<cPawn*>(&a_EntityHit); m_World->DoWithEntityByID(GetCreatorUniqueID(), Callback); } } |