*Fix a bug that current cell is not set for creatures sometimes.
--HG-- branch : trunk
This commit is contained in:
+4
-4
@@ -1040,6 +1040,7 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell)
|
|||||||
|
|
||||||
RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell);
|
RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell);
|
||||||
AddToGrid(c,getNGrid(new_cell.GridX(), new_cell.GridY()),new_cell);
|
AddToGrid(c,getNGrid(new_cell.GridX(), new_cell.GridY()),new_cell);
|
||||||
|
c->SetCurrentCell(new_cell);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1053,10 +1054,9 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell);
|
RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell);
|
||||||
{
|
EnsureGridCreated(GridPair(new_cell.GridX(), new_cell.GridY()));
|
||||||
EnsureGridCreated(GridPair(new_cell.GridX(), new_cell.GridY()));
|
AddToGrid(c,getNGrid(new_cell.GridX(), new_cell.GridY()),new_cell);
|
||||||
AddToGrid(c,getNGrid(new_cell.GridX(), new_cell.GridY()),new_cell);
|
c->SetCurrentCell(new_cell);
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user