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

This commit is contained in:
megamage
2011-11-28 14:05:25 -05:00
parent cde7ea260e
commit 529af3cd09
12 changed files with 79 additions and 42 deletions
+2 -4
View File
@@ -365,13 +365,11 @@ void PoolGroup<Creature>::Spawn1Object(PoolObject* obj)
{
Creature* creature = new Creature;
//sLog->outDebug(LOG_FILTER_POOLSYS, "Spawning creature %u", guid);
if (!creature->LoadFromDB(obj->guid, map))
if (!creature->LoadCreatureFromDB(obj->guid, map))
{
delete creature;
return;
}
else
map->AddToMap(creature);
}
}
}
@@ -391,7 +389,7 @@ void PoolGroup<GameObject>::Spawn1Object(PoolObject* obj)
{
GameObject* pGameobject = new GameObject;
//sLog->outDebug(LOG_FILTER_POOLSYS, "Spawning gameobject %u", guid);
if (!pGameobject->LoadFromDB(obj->guid, map))
if (!pGameobject->LoadGameObjectFromDB(obj->guid, map, false))
{
delete pGameobject;
return;