Delete obj if it is not successfully added to grid. More to fix.

This commit is contained in:
megamage committed 2011-11-28 14:05:25 -05:00
1 parent cde7ea260e
commit 529af3cd09
12 files changed
+79 -42

No files matched your search

+1 -3
View File
@@ -165,14 +165,12 @@ public:
object->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), player->GetPhaseMaskForSpawn());
// this will generate a new guid if the object is in an instance
if (!object->LoadFromDB(guidLow, map))
if (!object->LoadGameObjectFromDB(guidLow, map))
{
delete object;
return false;
}
map->AddToMap(object);
// TODO: is it really necessary to add both the real and DB table guid here ?
sObjectMgr->AddGameobjectToGrid(guidLow, sObjectMgr->GetGOData(guidLow));