diff options
author | megamage <none@none> | 2009-02-22 17:13:11 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-22 17:13:11 -0600 |
commit | 90d5e05aafff0f3dabd294811b4f82b024317a4a (patch) | |
tree | e14cdf231566388f0072b7267062f0e906c581a4 | |
parent | 9bb780793556fc82e45fd56a6f59c27d4050eb94 (diff) |
*Change "if" in SwitchGridContainers to assert.
--HG--
branch : trunk
-rw-r--r-- | src/game/Map.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp index b3006709556..a17604f5dd5 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -312,16 +312,16 @@ void Map::RemoveFromGrid(Creature* obj, NGridType *grid, Cell const& cell) } template<class T> -void Map::SwitchGridContainers(T* obj, bool active) +void Map::SwitchGridContainers(T* obj, bool apply) { CellPair pair = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY()); Cell cell(pair); NGridType *ngrid = getNGrid(cell.GridX(), cell.GridY()); GridType &grid = (*ngrid)(cell.CellX(), cell.CellY()); - if (active) + if(apply) { - if (!grid.GetWorldObject(obj->GetGUID(), obj)) + assert(!grid.GetWorldObject(obj->GetGUID(), obj)) { grid.RemoveGridObject<T>(obj, obj->GetGUID()); grid.AddWorldObject<T>(obj, obj->GetGUID()); @@ -329,7 +329,7 @@ void Map::SwitchGridContainers(T* obj, bool active) } else { - if (!grid.GetGridObject(obj->GetGUID(), obj)) + assert(!grid.GetGridObject(obj->GetGUID(), obj)) { grid.RemoveWorldObject<T>(obj, obj->GetGUID()); grid.AddGridObject<T>(obj, obj->GetGUID()); |