diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-02-01 11:50:09 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-01 11:50:09 +1100 |
commit | 70c4094c58b83b61c47ec3188cdb510c87742db0 (patch) | |
tree | 6e933f39dac07346be018642e1d33397183bc50c | |
parent | 26318472079542807a493993b9e125c8f9126771 (diff) | |
parent | 11caad6a6e07581c94a28e6711d4672501068d38 (diff) |
Merge pull request #173 from KrashV/main
Change your position on warp to the same planet
-rw-r--r-- | source/game/StarUniverseClient.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/game/StarUniverseClient.cpp b/source/game/StarUniverseClient.cpp index 12d72ee..af33508 100644 --- a/source/game/StarUniverseClient.cpp +++ b/source/game/StarUniverseClient.cpp @@ -416,6 +416,17 @@ void UniverseClient::warpPlayer(WarpAction const& warpAction, bool animate, Stri return; m_mainPlayer->stopLounging(); + + // Check if the warp target is within the same world + if (auto warpToWorld = warpAction.ptr<WarpToWorld>()) { + if (warpToWorld->world.empty() || warpToWorld->world == playerWorld()) { + if (auto pos = warpToWorld->target.ptr<SpawnTargetPosition>()) { + m_mainPlayer->moveTo(*pos); // Add a little space to up + return; + } + } + } + if (animate) { m_mainPlayer->teleportOut(animationType, deploy); m_warping = warpAction; |