From e3d00708a9e018ae4adf9f4957d5df27b5245a8c Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 11 Aug 2009 10:01:39 -0500 Subject: *Fix a crash since the last rev. --HG-- branch : trunk --- src/game/Map.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/Map.cpp b/src/game/Map.cpp index b7612e56072..5aeb043a92f 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -519,9 +519,14 @@ Map::Add(T *obj) return; } - obj->SetMap(this); - Cell cell(p); + if(obj->IsInWorld()) // need some clean up later + { + UpdateObjectVisibility(obj,cell,p); // is this needed? + AddNotifier(obj); + return; + } + if(obj->isActiveObject()) EnsureGridLoadedAtEnter(cell); else @@ -531,6 +536,7 @@ Map::Add(T *obj) assert( grid != NULL ); AddToGrid(obj,grid,cell); + obj->SetMap(this); obj->AddToWorld(); if(obj->isActiveObject()) -- cgit v1.2.3