| 438 | } |
| 439 | |
| 440 | void UniverseClient::warpPlayer(WarpAction const& warpAction, bool animate, String const& animationType, bool deploy) { |
| 441 | // don't interrupt teleportation in progress |
| 442 | if (m_warping || m_respawning) |
| 443 | return; |
| 444 | |
| 445 | m_mainPlayer->stopLounging(); |
| 446 | |
| 447 | // Check if the warp target is within the same world |
| 448 | if (auto warpToWorld = warpAction.ptr<WarpToWorld>()) { |
| 449 | if (warpToWorld->world.empty() || warpToWorld->world == playerWorld()) { |
| 450 | if (auto pos = warpToWorld->target.ptr<SpawnTargetPosition>()) { |
| 451 | m_mainPlayer->moveTo(*pos); |
| 452 | return; |
| 453 | } |
| 454 | } |
| 455 | } |
| 456 | |
| 457 | if (animate) { |
| 458 | m_mainPlayer->teleportOut(animationType, deploy); |
| 459 | m_warping = warpAction; |
| 460 | m_warpDelay.reset(); |
| 461 | } |
| 462 | |
| 463 | m_pendingWarp = warpAction; |
| 464 | } |
| 465 | |
| 466 | void UniverseClient::flyShip(Vec3I const& system, SystemLocation const& destination, Json const& settings) { |
| 467 | m_connection->pushSingle(make_shared<FlyShipPacket>(system, destination, settings)); |
nothing calls this directly
no test coverage detected