mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-14 00:23:50 +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
|
|
@ -6587,7 +6587,11 @@ void GameHandler::mailMarkAsRead(uint32_t mailId) {
|
|||
|
||||
glm::vec3 GameHandler::getComposedWorldPosition() {
|
||||
if (playerTransportGuid_ != 0 && transportManager_) {
|
||||
return transportManager_->getPlayerWorldPosition(playerTransportGuid_, playerTransportOffset_);
|
||||
auto* tr = transportManager_->getTransport(playerTransportGuid_);
|
||||
if (tr) {
|
||||
return transportManager_->getPlayerWorldPosition(playerTransportGuid_, playerTransportOffset_);
|
||||
}
|
||||
// Transport not tracked — fall through to normal position
|
||||
}
|
||||
// Not on transport, return normal movement position
|
||||
return glm::vec3(movementInfo.x, movementInfo.y, movementInfo.z);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue