mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Core/Transports: no longer allow transports to spawn on invalid maps
This commit is contained in:
@@ -223,6 +223,29 @@ void TransportMgr::LoadTransportTemplates()
|
||||
if (!goInfo->moTransport.taxiPathID)
|
||||
continue;
|
||||
|
||||
if (!sTaxiPathStore.LookupEntry(goInfo->moTransport.taxiPathID))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Transport {} (name: {}) has an invalid path specified in `gameobject_template`.`Data0` ({}) field, skipped.", entry, goInfo->name.c_str(), goInfo->moTransport.taxiPathID);
|
||||
continue;
|
||||
}
|
||||
|
||||
bool hasValidMaps = true;
|
||||
for (uint32 mapId : _transportTemplates[entry].MapIds)
|
||||
{
|
||||
if (!sMapStore.LookupEntry(mapId))
|
||||
{
|
||||
hasValidMaps = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasValidMaps)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Transport {} (name: {}) is trying to spawn on a map which does not exist, skipped.", entry, goInfo->name.c_str());
|
||||
_transportTemplates.erase(entry);
|
||||
continue;
|
||||
}
|
||||
|
||||
// paths are generated per template, saves us from generating it again in case of instanced transports
|
||||
TransportTemplate& transport = _transportTemplates[entry];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user