Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarUniverseClient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/game/StarUniverseClient.cpp')
-rw-r--r--source/game/StarUniverseClient.cpp11
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;