*Fix a crash since the last rev.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-11 10:01:39 -05:00
parent 6cb0466eea
commit e3d00708a9
+8 -2
View File
@@ -519,9 +519,14 @@ Map::Add(T *obj)
return; return;
} }
obj->SetMap(this);
Cell cell(p); Cell cell(p);
if(obj->IsInWorld()) // need some clean up later
{
UpdateObjectVisibility(obj,cell,p); // is this needed?
AddNotifier(obj);
return;
}
if(obj->isActiveObject()) if(obj->isActiveObject())
EnsureGridLoadedAtEnter(cell); EnsureGridLoadedAtEnter(cell);
else else
@@ -531,6 +536,7 @@ Map::Add(T *obj)
assert( grid != NULL ); assert( grid != NULL );
AddToGrid(obj,grid,cell); AddToGrid(obj,grid,cell);
obj->SetMap(this);
obj->AddToWorld(); obj->AddToWorld();
if(obj->isActiveObject()) if(obj->isActiveObject())