diff --git a/entities.lua b/entities.lua index 03f7364..0ebc768 100755 --- a/entities.lua +++ b/entities.lua @@ -435,12 +435,6 @@ minetest.register_entity("ap_airship:airship", { if colinfo then self.isonground = colinfo.touching_ground - else - if self.lastvelocity.y==0 and vel.y==0 then - self.isonground = true - else - self.isonground = false - end end self:physics() @@ -554,7 +548,7 @@ minetest.register_entity("ap_airship:airship", { local wind_yaw = minetest.dir_to_yaw(wind) --minetest.chat_send_all("x: "..wind.x.. " - z: "..wind.z.." - yaw: "..math.deg(wind_yaw).. " - orig: "..wind_yaw) - if self.anchored == false then + if self.anchored == false and self.isonground == false then accel = vector.add(accel, wind) else accel = vector.new() @@ -573,6 +567,12 @@ minetest.register_entity("ap_airship:airship", { self.object:set_bone_position("timao", {x=0,y=-22.562,z=176.018}, {x=0,y=0,z=self._rudder_angle*8}) self.object:set_bone_position("compass_axis", {x=0,y=-21.8,z=178.757}, {x=0, y=S_angle, z=0}) + if self.isonground then + self.object:set_bone_position("door", {x=0,y=-13.1266,z=54.1922}, {x=-18,y=0,z=0}) + else + self.object:set_bone_position("door", {x=0,y=-13.1266,z=54.1922}, {x=0,y=0,z=0}) + end + --saves last velocy for collision detection (abrupt stop) self._last_vel = self.object:get_velocity() self._last_accell = accel diff --git a/models/ap_airship_mesh.b3d b/models/ap_airship_mesh.b3d index 3f7383a..3edb005 100755 Binary files a/models/ap_airship_mesh.b3d and b/models/ap_airship_mesh.b3d differ diff --git a/utilities.lua b/utilities.lua index f43533f..4c5adad 100755 --- a/utilities.lua +++ b/utilities.lua @@ -267,6 +267,8 @@ function ap_airship.destroy(self, overload) if self._passengers_base[3] then self._passengers_base[3]:remove() end if self._passengers_base[4] then self._passengers_base[4]:remove() end if self._passengers_base[5] then self._passengers_base[5]:remove() end + if self._cabin_interactor then self._cabin_interactor:remove() end + if self._control_interactor then self._control_interactor:remove() end airutils.destroy_inventory(self) self.object:remove()