diff options
| author | megamage <none@none> | 2009-02-26 10:42:37 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2009-02-26 10:42:37 -0600 |
| commit | 4b19153a79f70f1c816d084dda8eca1f666ac5dd (patch) | |
| tree | ea8f1575d527c8e9104b19cd957f25fddbf9922b /src/game | |
| parent | 1af157d0129add19d88e554188f58cc60653dc89 (diff) | |
*Fix a crash caused by far sight spells.
--HG--
branch : trunk
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/Map.cpp | 3 | ||||
| -rw-r--r-- | src/game/Object.cpp | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 6934bcf3df1..2e81d651d8b 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -844,10 +844,9 @@ Map::Remove(T *obj, bool remove) NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); assert( grid != NULL ); + obj->RemoveFromWorld(); if(obj->isActiveObject()) RemoveFromActive(obj); - - obj->RemoveFromWorld(); RemoveFromGrid(obj,grid,cell); UpdateObjectVisibility(obj,cell,p); diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 5551f844376..f35b392991e 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1082,9 +1082,9 @@ void WorldObject::setActive( bool on ) { map = GetMap(); if(GetTypeId() == TYPEID_UNIT) - map->Remove((Creature*)this,false); + map->RemoveFromActive((Creature*)this); else if(GetTypeId() == TYPEID_DYNAMICOBJECT) - map->Remove((DynamicObject*)this,false); + map->RemoveFromActive((DynamicObject*)this); } m_isActive = on; @@ -1092,9 +1092,9 @@ void WorldObject::setActive( bool on ) if(world) { if(GetTypeId() == TYPEID_UNIT) - map->Add((Creature*)this); + map->AddToActive((Creature*)this); else if(GetTypeId() == TYPEID_DYNAMICOBJECT) - map->Add((DynamicObject*)this); + map->AddToActive((DynamicObject*)this); } } |
