diff --git a/src/spaceObjects/playerSpaceship.cpp b/src/spaceObjects/playerSpaceship.cpp index ff92f3e79..69ed315b0 100644 --- a/src/spaceObjects/playerSpaceship.cpp +++ b/src/spaceObjects/playerSpaceship.cpp @@ -1399,6 +1399,7 @@ void PlayerSpaceship::onReceiveClientCommand(int32_t client_id, sp::io::DataBuff break; case CMD_WARP: packet >> warp_request; + warp_request = std::clamp(int(warp_request), 0, 4); break; case CMD_JUMP: { diff --git a/src/spaceObjects/spaceship.cpp b/src/spaceObjects/spaceship.cpp index 3783914f4..52f7d3b16 100644 --- a/src/spaceObjects/spaceship.cpp +++ b/src/spaceObjects/spaceship.cpp @@ -1274,6 +1274,7 @@ void SpaceShip::collide(Collisionable* other, float force) void SpaceShip::initializeJump(float distance) { + distance = std::clamp(distance, jump_drive_min_distance, jump_drive_max_distance); if (docking_state != DS_NotDocking) return; if (jump_drive_charge < jump_drive_max_distance) // You can only jump when the drive is fully charged