From a5df77a9d6f3e48f2c4e8a61d60e3b5f2f0c326e Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 19 Apr 2018 23:37:41 +0200 Subject: Core/Transports: Force transport passengers into legacy spawn group Ref #21641 --- src/server/game/Entities/Transport/Transport.cpp | 8 +++++++- src/server/game/Globals/ObjectMgr.cpp | 18 ++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index b8880564155..52ef320b886 100644 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -300,9 +300,12 @@ void Transport::RemovePassenger(WorldObject* passenger) Creature* Transport::CreateNPCPassenger(ObjectGuid::LowType guid, CreatureData const* data) { Map* map = GetMap(); + if (map->GetCreatureRespawnTime(guid)) + return nullptr; + Creature* creature = new Creature(); - if (!creature->LoadFromDB(guid, map, false, true)) + if (!creature->LoadFromDB(guid, map, false, false)) { delete creature; return nullptr; @@ -345,6 +348,9 @@ Creature* Transport::CreateNPCPassenger(ObjectGuid::LowType guid, CreatureData c GameObject* Transport::CreateGOPassenger(ObjectGuid::LowType guid, GameObjectData const* data) { Map* map = GetMap(); + if (map->GetGORespawnTime(guid)) + return nullptr; + GameObject* go = new GameObject(); if (!go->LoadFromDB(guid, map, false)) diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 00461bbfb99..0d6e5f7bd0e 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1859,8 +1859,13 @@ void ObjectMgr::LoadCreatures() } // Skip spawnMask check for transport maps - if (!IsTransportMap(data.spawnPoint.GetMapId()) && data.spawnMask & ~spawnMasks[data.spawnPoint.GetMapId()]) - TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: %u) that have wrong spawn mask %u including unsupported difficulty modes for map (Id: %u).", guid, data.spawnMask, data.spawnPoint.GetMapId()); + if (!IsTransportMap(data.spawnPoint.GetMapId())) + { + if (data.spawnMask & ~spawnMasks[data.spawnPoint.GetMapId()]) + TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: %u) that have wrong spawn mask %u including unsupported difficulty modes for map (Id: %u).", guid, data.spawnMask, data.spawnPoint.GetMapId()); + } + else + data.spawnGroupData = &_spawnGroupDataStore[1]; // force compatibility group for transport spawns bool ok = true; for (uint32 diff = 0; diff < MAX_DIFFICULTY - 1 && ok; ++diff) @@ -2173,8 +2178,13 @@ void ObjectMgr::LoadGameObjects() data.spawnMask = fields[14].GetUInt8(); - if (!IsTransportMap(data.spawnPoint.GetMapId()) && data.spawnMask & ~spawnMasks[data.spawnPoint.GetMapId()]) - TC_LOG_ERROR("sql.sql", "Table `gameobject` has gameobject (GUID: %u Entry: %u) that has wrong spawn mask %u including unsupported difficulty modes for map (Id: %u), skip", guid, data.id, data.spawnMask, data.spawnPoint.GetMapId()); + if (!IsTransportMap(data.spawnPoint.GetMapId())) + { + if (data.spawnMask & ~spawnMasks[data.spawnPoint.GetMapId()]) + TC_LOG_ERROR("sql.sql", "Table `gameobject` has gameobject (GUID: %u Entry: %u) that has wrong spawn mask %u including unsupported difficulty modes for map (Id: %u), skip", guid, data.id, data.spawnMask, data.spawnPoint.GetMapId()); + } + else + data.spawnGroupData = &_spawnGroupDataStore[1]; // force compatibility group for transport spawns data.phaseMask = fields[15].GetUInt32(); int16 gameEvent = fields[16].GetInt8(); -- cgit v1.2.3