mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-05 16:43:52 +00:00
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:
parent
910ba50c26
commit
fe29ccad3f
3 changed files with 17 additions and 6 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue