mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +00:00
fix(Core/Transports): Improve static transport visibility (#22660)
This commit is contained in:
@@ -64,15 +64,28 @@ void GridObjectLoader::LoadGameObjects(CellGuidSet const& guid_set, Map* map)
|
||||
for (ObjectGuid::LowType const& guid : guid_set)
|
||||
{
|
||||
GameObjectData const* data = sObjectMgr->GetGameObjectData(guid);
|
||||
GameObject* obj = data && sObjectMgr->IsGameObjectStaticTransport(data->id) ? new StaticTransport() : new GameObject();
|
||||
|
||||
if (!obj->LoadFromDB(guid, map))
|
||||
if (data && sObjectMgr->IsGameObjectStaticTransport(data->id))
|
||||
{
|
||||
delete obj;
|
||||
continue;
|
||||
}
|
||||
StaticTransport* transport = new StaticTransport();
|
||||
|
||||
AddObjectHelper<GameObject>(map, obj);
|
||||
// Special case for static transports - we are loaded via grids
|
||||
// but we do not want to actually be stored in the grid
|
||||
if (!transport->LoadGameObjectFromDB(guid, map, true))
|
||||
delete transport;
|
||||
}
|
||||
else
|
||||
{
|
||||
GameObject* obj = new GameObject();
|
||||
|
||||
if (!obj->LoadFromDB(guid, map))
|
||||
{
|
||||
delete obj;
|
||||
continue;
|
||||
}
|
||||
|
||||
AddObjectHelper<GameObject>(map, obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user