Delete obj if it is not successfully added to grid. More to fix.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user