fix(transport): guard against untracked transport placing player at map origin

When on-transport flag is set but the transport isn't tracked by
TransportManager, getPlayerWorldPosition() returns localOffset (a small
relative value) as a world position. This overwrites movementInfo with
near-zero coordinates, teleporting the player to map origin on Eastern
Kingdoms (Alterac/Hillsbrad area). Add transport existence checks in
sendMovement() and getComposedWorldPosition() before composing position.
This commit is contained in:
Kelsi 2026-04-05 16:01:14 -07:00
parent 910ba50c26
commit fe29ccad3f
3 changed files with 17 additions and 6 deletions

View file

@ -141,7 +141,9 @@ ActiveTransport* TransportManager::getTransport(uint64_t guid) {
glm::vec3 TransportManager::getPlayerWorldPosition(uint64_t transportGuid, const glm::vec3& localOffset) {
auto* transport = getTransport(transportGuid);
if (!transport) {
return localOffset; // Fallback
LOG_WARNING("getPlayerWorldPosition: transport 0x", std::hex, transportGuid, std::dec,
" not found — returning localOffset as-is (callers should guard)");
return localOffset;
}
if (transport->isM2) {