aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-04 09:33:15 -0600
committermegamage <none@none>2009-03-04 09:33:15 -0600
commit3ca5db7ebc5e1f5149cb7140f75eaac7ab9c038e (patch)
treeb1cd465fb65cea328019bf656946637f9e1e363e /src
parente3eba9331ee21011049c6ef4cdaa101144ed9c47 (diff)
*Fix a bug that current cell is not set for creatures sometimes.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Map.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index 1bb000b6d80..42e21f9b5eb 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -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;
}