diff options
author | Degranon <boba09@list.ru> | 2025-02-01 01:45:34 +0100 |
---|---|---|
committer | Degranon <boba09@list.ru> | 2025-02-01 01:45:34 +0100 |
commit | 11caad6a6e07581c94a28e6711d4672501068d38 (patch) | |
tree | 6e933f39dac07346be018642e1d33397183bc50c /source/game | |
parent | 5aa02ed749c3eb3411f6621ca45ac59d9428392c (diff) |
Use Player:MoveTo instead of mcontroller->setPosition
Diffstat (limited to 'source/game')
-rw-r--r-- | source/game/StarUniverseClient.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source/game/StarUniverseClient.cpp b/source/game/StarUniverseClient.cpp index 279d63d..af33508 100644 --- a/source/game/StarUniverseClient.cpp +++ b/source/game/StarUniverseClient.cpp @@ -417,14 +417,12 @@ void UniverseClient::warpPlayer(WarpAction const& warpAction, bool animate, Stri m_mainPlayer->stopLounging(); - // Check if the warp target is within the same world - if (warpAction.is<WarpToWorld>()) { - if (auto warpToWorld = warpAction.ptr<WarpToWorld>()) { - if (warpToWorld->world.empty() || warpToWorld->world == playerWorld()) { - if (auto pos = warpToWorld->target.ptr<SpawnTargetPosition>()) { - m_mainPlayer->movementController()->setPosition(*pos + Vec2F{0, 2}); // Add a little space to up - return; - } + // 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; } } } |