Delete obj if it is not successfully added to grid. More to fix.
This commit is contained in:
@@ -1176,10 +1176,8 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
|
||||
{
|
||||
Creature* creature = new Creature;
|
||||
//sLog->outDebug("Spawning creature %u", *itr);
|
||||
if (!creature->LoadFromDB(*itr, map))
|
||||
if (!creature->LoadCreatureFromDB(*itr, map))
|
||||
delete creature;
|
||||
else
|
||||
map->AddToMap(creature);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1205,7 +1203,8 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
|
||||
{
|
||||
GameObject* pGameobject = new GameObject;
|
||||
//sLog->outDebug("Spawning gameobject %u", *itr);
|
||||
if (!pGameobject->LoadFromDB(*itr, map))
|
||||
//TODO: find out when it is add to map
|
||||
if (!pGameobject->LoadGameObjectFromDB(*itr, map, false))
|
||||
delete pGameobject;
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user