diff --git a/entities.lua b/entities.lua index f29b0e9..05cefe1 100755 --- a/entities.lua +++ b/entities.lua @@ -389,7 +389,7 @@ minetest.register_entity('ap_airship:exit_interactor',{ minetest.register_entity('ap_airship:chair_interactor',{ initial_properties = { physical = false, - collide_with_objects=false, + collide_with_objects=true, collisionbox = {-0.3, 0, -0.3, 0.3, 1, 0.3}, pointable=true, visual = "mesh", @@ -458,7 +458,7 @@ minetest.register_entity('ap_airship:ent_collider',{ minetest.register_entity('ap_airship:stand_base',{ initial_properties = { physical = true, - collide_with_objects=true, + collide_with_objects=false, collisionbox = {-2, -2, -2, 2, 0, 2}, pointable=false, visual = "mesh", diff --git a/forms.lua b/forms.lua index 2e0bae7..78fac9a 100755 --- a/forms.lua +++ b/forms.lua @@ -29,11 +29,14 @@ function ap_airship.pilot_formspec(name) if ent._at_control then take_control = "true" end local anchor = "false" if ent.anchored == true then anchor = "true" end + local rescue = "false" + if ent._rescue_plane == true then rescue = "true" end basic_form = basic_form.."button[1,1.0;4,1;turn_on;Start/Stop engines]" basic_form = basic_form.."button[1,3.0;4,1;inventory;Open inventory]" --basic_form = basic_form.."button[1,4.0;4,1;manual;Show Manual Menu]" + basic_form = basic_form.."checkbox[1,4.4;rescue;Rescue external plane;"..rescue.."]" basic_form = basic_form.."checkbox[1,5.6;take_control;Take the Control;"..take_control.."]" basic_form = basic_form.."checkbox[1,6.2;anchor;Anchor away;"..anchor.."]" @@ -213,6 +216,17 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if fields.manual then ap_airship.manual_formspec(name) end + + if fields.rescue then + if fields.rescue == "true" then + ent._rescue_plane = true + minetest.chat_send_player(name,core.colorize('#00ff00', " >>> Rescue plane in flight is turned on.")) + else + ent._rescue_plane = false + minetest.chat_send_player(name,core.colorize('#ff0000', " >>> Rescue plane in flight is turned off.")) + end + end + if fields.take_control then if fields.take_control == "true" then if ent.driver_name == nil or ent.driver_name == "" then diff --git a/utilities.lua b/utilities.lua index 2dbf3be..f52d56a 100755 --- a/utilities.lua +++ b/utilities.lua @@ -491,7 +491,7 @@ end function ap_airship.timed_anchor_entity(self, curr_pos, yaw, time, dtime) local time = time or 0 if self._vehicle_custom_data.simple_external_attach_entity ~= nil then return end - if not self._timed_anchor_counter then self._timed_anchor_counter = time end + if not self._timed_anchor_counter then self._timed_anchor_counter = 0 end self._timed_anchor_counter = self._timed_anchor_counter + dtime if self._timed_anchor_counter < time then return nil, nil end --go out before the right time