From 8c12227687454abe5bdd0b8796f84f15fd3817d8 Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Sat, 16 Jan 2016 14:16:47 +0200 Subject: Fix crash when tamed wolf is hit by arrows --- src/Entities/ProjectileEntity.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Entities/ProjectileEntity.cpp') diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp index 4c89ea965..bb08f38d9 100644 --- a/src/Entities/ProjectileEntity.cpp +++ b/src/Entities/ProjectileEntity.cpp @@ -316,12 +316,13 @@ void cProjectileEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_Hi { if (a_EntityHit.IsPawn() && (GetCreatorName() != "")) // If we're hitting a mob or a player and we were created by a player { + class cNotifyWolves : public cEntityCallback { public: - cEntity * m_EntityHit; + cPawn * m_EntityHit; - cNotifyWolves(cEntity * a_Entity) : + cNotifyWolves(cPawn * a_Entity) : m_EntityHit(a_Entity) { } @@ -331,7 +332,7 @@ void cProjectileEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_Hi static_cast(a_Player)->NotifyFriendlyWolves(m_EntityHit); return true; } - } Callback(&a_EntityHit); + } Callback(static_cast(&a_EntityHit)); m_World->DoWithEntityByID(GetCreatorUniqueID(), Callback); } -- cgit v1.2.3