mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Core/Transports: Log an error if a Transport has no GameObject template
Log an error if a Transport has no GameObject template from `gameobject_template` table instead of dereferencing NULL .
This commit is contained in:
@@ -60,6 +60,12 @@ void TransportMgr::LoadTransportTemplates()
|
||||
Field* fields = result->Fetch();
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
GameObjectTemplate const* goInfo = sObjectMgr->GetGameObjectTemplate(entry);
|
||||
if (goInfo == NULL)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Transport %u has no associated GameObjectTemplate from `gameobject_template` , skipped.", entry);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (goInfo->moTransport.taxiPathId >= sTaxiPathNodesByPath.size())
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Transport %u (name: %s) has an invalid path specified in `gameobject_template`.`data0` (%u) field, skipped.", entry, goInfo->name.c_str(), goInfo->moTransport.taxiPathId);
|
||||
|
||||
Reference in New Issue
Block a user