Warp Drive Machine


You are in relative control of a spacecraft equipped with a warp drive that distorts the shape of the space-time continuum and may travel at speeds greater than that of light by many orders of magnitude. Jump from planet to planet and extract most resources you can to rebuild you ship. Each planet is unique with its own challenges, and you can stay limited time on it, until spaceship warps toward another world.

Overhaul
14 days ago
1.1 - 2.1
20.6K

b Left behind if disconnected before warping

4 days ago

We noticed that sometimes if a player disconnects while on floor 0 of the ship and it warps, they are stranded on the old planet when they rejoin.
If it's a persistent planet, it's fine. But if it's not persistent, they will die and their stuff is all lost.

After having both messed around a little in game but also looked through the mod code I think I have found why.
When a player joins, you call send_player_to_ship if they aren't on a persistent surface. However, if the player had the map open while disconnecting they will still have the map open when rejoining and the player.surface will give you the surface the player is looking at not the player character itself.
You already work around this for connected players by calling exit_remote_view() when the ship warps, but you never do it for a rejoining player.

So I believe an easy fix is to call exit_remote_view() on a rejoining player too before trying to teleport them to the ship.

New response