mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
Core/Transports: force transport spawns into legacy group
This commit is contained in:
@@ -297,9 +297,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;
|
||||
@@ -344,6 +347,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))
|
||||
|
||||
@@ -1961,8 +1961,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)
|
||||
@@ -2323,8 +2328,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();
|
||||
|
||||
@@ -356,13 +356,11 @@ public:
|
||||
data.phaseMask = chr->GetPhaseMask();
|
||||
data.spawnPoint.Relocate(chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO());
|
||||
|
||||
Creature* creature = trans->CreateNPCPassenger(guid, &data);
|
||||
|
||||
// creature->CopyPhaseFrom(chr); // will not be saved, and probably useless
|
||||
|
||||
creature->SaveToDB(trans->GetGOInfo()->moTransport.mapID, 1 << map->GetSpawnMode(), chr->GetPhaseMask());
|
||||
|
||||
sObjectMgr->AddCreatureToGrid(guid, &data);
|
||||
if (Creature* creature = trans->CreateNPCPassenger(guid, &data))
|
||||
{
|
||||
creature->SaveToDB(trans->GetGOInfo()->moTransport.mapID, 1 << map->GetSpawnMode(), chr->GetPhaseMask());
|
||||
sObjectMgr->AddCreatureToGrid(guid, &data);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user