*Fix a bug that current cell is not set for creatures sometimes.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-04 09:33:15 -06:00
parent e3eba9331e
commit 3ca5db7ebc

View File

@@ -1040,6 +1040,7 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell)
RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell);
AddToGrid(c,getNGrid(new_cell.GridX(), new_cell.GridY()),new_cell);
c->SetCurrentCell(new_cell);
return true;
}
@@ -1053,10 +1054,9 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell)
#endif
RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell);
{
EnsureGridCreated(GridPair(new_cell.GridX(), new_cell.GridY()));
AddToGrid(c,getNGrid(new_cell.GridX(), new_cell.GridY()),new_cell);
}
EnsureGridCreated(GridPair(new_cell.GridX(), new_cell.GridY()));
AddToGrid(c,getNGrid(new_cell.GridX(), new_cell.GridY()),new_cell);
c->SetCurrentCell(new_cell);
return true;
}