From ef5d85676381f725f0eeb49523338b607de086fd Mon Sep 17 00:00:00 2001 From: Jozef Behran Date: Sat, 2 Mar 2019 14:02:37 -0500 Subject: [PATCH] Clean up abandoned spaceships When a player leaves, his spaceship is left behind, lurking around the data and taking space in the block. Clean up this debris by checking whether the spaceship has its driver still present and removing it if not. --- mods/saturn/player.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mods/saturn/player.lua b/mods/saturn/player.lua index 0be0ec4..c97aea9 100644 --- a/mods/saturn/player.lua +++ b/mods/saturn/player.lua @@ -617,6 +617,9 @@ local spaceship = { function spaceship:on_step(dtime) self.age = self.age + dtime + if not self.driver then + self.object:remove() + end if self.driver and self.driver:get_look_dir() then local player = self.driver local name = player:get_player_name()