Core/Transport: Prevent creature passengers from teleporting to an invalid grid.

--HG--
branch : trunk
This commit is contained in:
linencloth
2010-10-25 02:30:50 +02:00
parent 910264070c
commit 3742e8ddec
3 changed files with 8 additions and 12 deletions

View File

@@ -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))
{