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

+5 -2
View File
@@ -147,9 +147,12 @@ public:
uint32 db_guid = creature->GetDBTableGUIDLow();
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
creature->LoadFromDB(db_guid, map);
if (!creature->LoadCreatureFromDB(db_guid, map))
{
delete creature;
return false;
}
map->AddToMap(creature);
sObjectMgr->AddCreatureToGrid(db_guid, sObjectMgr->GetCreatureData(db_guid));
return true;
}