fix(Core/Transports): Improve static transport visibility (#22660)

This commit is contained in:
Takenbacon
2025-08-10 12:15:55 -07:00
committed by GitHub
parent ba1fcf2424
commit 2485ff7f5f
9 changed files with 92 additions and 55 deletions

View File

@@ -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);
}
}
}