improved remotion

This commit is contained in:
Alexsandro Percy 2024-03-10 12:34:36 -03:00
parent 8f2e6360d0
commit 8e516909c6
2 changed files with 5 additions and 2 deletions

View file

@ -601,7 +601,7 @@ minetest.register_entity("ap_airship:airship", {
self.object:set_properties(properties) self.object:set_properties(properties)
if data.remove then if data.remove then
airutils.destroy_inventory(self) airutils.destroy_inventory(self)
self.object:remove() ap_airship.destroy(self)
return return
end end
end end

View file

@ -321,6 +321,7 @@ function ap_airship.destroy(self, overload)
if self._cabin2 then self._cabin2:remove() end if self._cabin2 then self._cabin2:remove() end
airutils.destroy_inventory(self) airutils.destroy_inventory(self)
local autofly = self._autoflymode
self.object:remove() self.object:remove()
pos.y=pos.y+2 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))) local boat_wear = math.floor(65535*(1-(self.hull_integrity/item_def.hull_integrity)))
stack:set_wear(boat_wear) stack:set_wear(boat_wear)
end 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 end
--returns 0 for old, 1 for new --returns 0 for old, 1 for new