From ab40cf8dd74e3f643c1e75f58d70156e5f9066ee Mon Sep 17 00:00:00 2001 From: sipertruk Date: Sun, 16 Jul 2017 02:49:55 +0200 Subject: [PATCH] reset eventai phase at grid unload/stop (#1381) --- src/game/Maps/Map.cpp | 2 +- src/game/ObjectGridLoader.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game/Maps/Map.cpp b/src/game/Maps/Map.cpp index 0dae0979c..a2cce4b60 100644 --- a/src/game/Maps/Map.cpp +++ b/src/game/Maps/Map.cpp @@ -1250,7 +1250,7 @@ bool Map::CreatureRespawnRelocation(Creature *c) CellPair resp_val = MaNGOS::ComputeCellPair(resp_x, resp_y); Cell resp_cell(resp_val); - c->CombatStop(); + c->AI()->EnterEvadeMode(); c->GetMotionMaster()->Clear(); DEBUG_FILTER_LOG(LOG_FILTER_CREATURE_MOVES, "Creature (GUID: %u Entry: %u) will moved from grid[%u,%u]cell[%u,%u] to respawn grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), c->GetCurrentCell().GridX(), c->GetCurrentCell().GridY(), c->GetCurrentCell().CellX(), c->GetCurrentCell().CellY(), resp_cell.GridX(), resp_cell.GridY(), resp_cell.CellX(), resp_cell.CellY()); diff --git a/src/game/ObjectGridLoader.cpp b/src/game/ObjectGridLoader.cpp index 18146d848..3d1fb93d3 100644 --- a/src/game/ObjectGridLoader.cpp +++ b/src/game/ObjectGridLoader.cpp @@ -24,6 +24,7 @@ #include "ObjectMgr.h" #include "MapPersistentStateMgr.h" #include "Creature.h" +#include "CreatureAI.h" #include "GameObject.h" #include "DynamicObject.h" #include "Corpse.h" @@ -332,7 +333,7 @@ ObjectGridStoper::Visit(CreatureMapType &m) // stop any fights at grid de-activation and remove dynobjects created at cast by creatures for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { - iter->getSource()->CombatStop(); + iter->getSource()->AI()->EnterEvadeMode(); iter->getSource()->DeleteThreatList(); iter->getSource()->RemoveAllDynObjects(); }