diff options
Diffstat (limited to 'src/server/game/Maps')
| -rwxr-xr-x | src/server/game/Maps/Map.cpp | 5 | ||||
| -rwxr-xr-x | src/server/game/Maps/Map.h | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index ff826e32887..ed77fee63dc 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -779,7 +779,7 @@ Map::PlayerRelocation(Player *player, float x, float y, float z, float orientati } void -Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang) +Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang, bool respawnRelocationOnFail) { ASSERT(CheckGridIntegrity(creature,false)); @@ -788,6 +788,9 @@ Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang CellPair new_val = Trinity::ComputeCellPair(x, y); Cell new_cell(new_val); + if (!respawnRelocationOnFail && !getNGrid(new_cell.GridX(), new_cell.GridY())) + return; + // delay creature move for grid/cell to grid/cell moves if (old_cell.DiffCell(new_cell) || old_cell.DiffGrid(new_cell)) { diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 7d87bba823f..534115e7e0d 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -276,7 +276,7 @@ class Map : public GridRefManager<NGridType> virtual void InitVisibilityDistance(); void PlayerRelocation(Player *, float x, float y, float z, float orientation); - void CreatureRelocation(Creature *creature, float x, float y, float z, float ang); + void CreatureRelocation(Creature *creature, float x, float y, float z, float ang, bool respawnRelocationOnFail = true); template<class T, class CONTAINER> void Visit(const Cell& cell, TypeContainerVisitor<T, CONTAINER> &visitor); |
