From 8e516909c66392198dc38d2bfe63ff09a5847253 Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Sun, 10 Mar 2024 12:34:36 -0300 Subject: [PATCH] improved remotion --- entities.lua | 2 +- utilities.lua | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/entities.lua b/entities.lua index 67a8d37..96f9f94 100755 --- a/entities.lua +++ b/entities.lua @@ -601,7 +601,7 @@ minetest.register_entity("ap_airship:airship", { self.object:set_properties(properties) if data.remove then airutils.destroy_inventory(self) - self.object:remove() + ap_airship.destroy(self) return end end diff --git a/utilities.lua b/utilities.lua index 4bcb4a4..1a790f6 100755 --- a/utilities.lua +++ b/utilities.lua @@ -321,6 +321,7 @@ function ap_airship.destroy(self, overload) if self._cabin2 then self._cabin2:remove() end airutils.destroy_inventory(self) + local autofly = self._autoflymode self.object:remove() pos.y=pos.y+2 @@ -356,7 +357,9 @@ function ap_airship.destroy(self, overload) local boat_wear = math.floor(65535*(1-(self.hull_integrity/item_def.hull_integrity))) stack:set_wear(boat_wear) end - minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5}, stack) + if not autofly then + minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5}, stack) + end end --returns 0 for old, 1 for new