From 4f262a24495eb75da3c0b18546ed4fdf3338c335 Mon Sep 17 00:00:00 2001 From: killerwife Date: Fri, 17 Nov 2023 23:40:08 +0100 Subject: [PATCH] Force transport passengers grid loading if player is present on map traversal --- src/game/Entities/Transports.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/game/Entities/Transports.cpp b/src/game/Entities/Transports.cpp index 25d86d063ba..ca661c2a35a 100644 --- a/src/game/Entities/Transports.cpp +++ b/src/game/Entities/Transports.cpp @@ -281,6 +281,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z, fl Relocate(x, y, z); bool mapChange = GetMapId() != newMapid; + bool playerPassenger = false; auto& passengers = GetPassengers(); for (m_passengerTeleportIterator = passengers.begin(); m_passengerTeleportIterator != passengers.end();) @@ -316,6 +317,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z, fl if (player->IsDead() && !player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) player->ResurrectPlayer(1.0); player->TeleportTo(newMapid, pos.x, pos.y, pos.z, pos.o, TELE_TO_NOT_LEAVE_TRANSPORT, nullptr, this); + playerPassenger = true; break; } case TYPEID_GAMEOBJECT: @@ -343,12 +345,14 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z, fl ResetMap(); Map* newMap = sMapMgr.CreateMap(newMapid, this); - newMap->GetMessager().AddMessage([transport = this](Map* map) + newMap->GetMessager().AddMessage([transport = this, playerPassenger](Map* map) { transport->SetMap(map); transport->Object::AddToWorld(); map->AddTransport(transport); transport->AddModelToMap(); + if (playerPassenger) + map->ForceLoadGrid(transport->GetPositionX(), transport->GetPositionY()); transport->SpawnPassengers(); transport->UpdateForMap(map, true); });