From 2359611c57edc70f68b1ba05bb87dbf9c3bbc11d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Beltr=C3=A1n?= Date: Sun, 21 May 2017 10:29:06 +0200 Subject: Don't destroy monster when last target type is a player (#3721) In current Cuberite version if you are pursued by monsters you just have to disconnect and connect again to get rid of them. If no other player is in your chunk monsters will get destroyed. --- src/Mobs/Monster.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Mobs/Monster.cpp') diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index ece59828e..f49175922 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -100,6 +100,7 @@ cMonster::cMonster(const AString & a_ConfigName, eMonsterType a_MobType, const A , m_RelativeWalkSpeed(1) , m_Age(1) , m_AgingTimer(20 * 60 * 20) // about 20 minutes + , m_WasLastTargetAPlayer(false) , m_Target(nullptr) { if (!a_ConfigName.empty()) @@ -945,6 +946,7 @@ void cMonster::SetTarget (cPawn * a_NewTarget) ASSERT(a_NewTarget->IsTicking()); // Notify the new target that we are now targeting it. m_Target->TargetingMe(this); + m_WasLastTargetAPlayer = m_Target->IsPlayer(); } } -- cgit v1.2.3