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/World.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/World.cpp') diff --git a/src/World.cpp b/src/World.cpp index 447e2cf25..d4be3addb 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -1149,8 +1149,8 @@ void cWorld::TickMobs(std::chrono::milliseconds a_Dt) { Monster->Tick(m_Dt, *(a_Entity->GetParentChunk())); } - // Destroy far hostile mobs - else if ((Monster->GetMobFamily() == cMonster::eFamily::mfHostile)) + // Destroy far hostile mobs except if last target was a player + else if ((Monster->GetMobFamily() == cMonster::eFamily::mfHostile) && !Monster->WasLastTargetAPlayer()) { if (Monster->GetMobType() != eMonsterType::mtWolf) { -- cgit v1.2.3