mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
*Allow players to capture siege workshops in wintergrasp.
--HG-- branch : trunk
This commit is contained in:
@@ -1392,6 +1392,10 @@ uint32 ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, float y, float
|
||||
if (!goinfo)
|
||||
return 0;
|
||||
|
||||
Map* map = const_cast<Map*>(MapManager::Instance().CreateBaseMap(mapId));
|
||||
if(!map)
|
||||
return 0;
|
||||
|
||||
uint32 guid = GenerateLowGuid(HIGHGUID_GAMEOBJECT);
|
||||
GameObjectData& data = NewGOData(guid);
|
||||
data.id = entry;
|
||||
@@ -1414,22 +1418,21 @@ uint32 ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, float y, float
|
||||
AddGameobjectToGrid(guid, &data);
|
||||
|
||||
// Spawn if necessary (loaded grids only)
|
||||
if(Map* map = const_cast<Map*>(MapManager::Instance().CreateBaseMap(mapId)))
|
||||
// We use spawn coords to spawn
|
||||
if(!map->Instanceable() && !map->IsRemovalGrid(x, y))
|
||||
{
|
||||
// We use spawn coords to spawn
|
||||
if(!map->Instanceable() && !map->IsRemovalGrid(x, y))
|
||||
GameObject *go = new GameObject;
|
||||
if(!go->LoadFromDB(guid, map))
|
||||
{
|
||||
GameObject *go = new GameObject;
|
||||
if(!go->LoadFromDB(guid, map))
|
||||
{
|
||||
sLog.outError("AddGameObject: cannot add gameobject entry %u to map", entry);
|
||||
delete go;
|
||||
return 0;
|
||||
}
|
||||
map->Add(go);
|
||||
sLog.outError("AddGOData: cannot add gameobject entry %u to map", entry);
|
||||
delete go;
|
||||
return 0;
|
||||
}
|
||||
map->Add(go);
|
||||
}
|
||||
|
||||
sLog.outDebug("AddGOData: dbguid %u entry %u map %u x %f y %f z %f o %f", guid, entry, mapId, x, y, z, o);
|
||||
|
||||
return guid;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user