[8680] Spawn objects only in loaded grids (not just created)

Real object creating in grid make sense only if grid data already loaded, in other cases
gameevent/pool related object will loaded at normal grid data loading.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
seirge 2009-10-20 11:20:28 +04:00 committed by VladimirMangos
parent dcadfb7cae
commit f015e77a07
4 changed files with 11 additions and 5 deletions

View file

@ -522,7 +522,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
// Spawn if necessary (loaded grids only)
Map* map = const_cast<Map*>(MapManager::Instance().CreateBaseMap(data->mapid));
// We use spawn coords to spawn
if(!map->Instanceable() && !map->IsRemovalGrid(data->posX,data->posY))
if(!map->Instanceable() && map->IsLoaded(data->posX,data->posY))
{
Creature* pCreature = new Creature;
//sLog.outDebug("Spawning creature %u",*itr);
@ -555,7 +555,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
// this base map checked as non-instanced and then only existed
Map* map = const_cast<Map*>(MapManager::Instance().CreateBaseMap(data->mapid));
// We use current coords to unspawn, not spawn coords since creature can have changed grid
if(!map->Instanceable() && !map->IsRemovalGrid(data->posX, data->posY))
if(!map->Instanceable() && map->IsLoaded(data->posX, data->posY))
{
GameObject* pGameobject = new GameObject;
//sLog.outDebug("Spawning gameobject %u", *itr);