mirror of
https://github.com/APercy/airutils.git
synced 2025-03-15 08:01:22 +00:00
fix player removal on ground
This commit is contained in:
parent
388b2062d7
commit
8f325e1418
2 changed files with 8 additions and 4 deletions
|
@ -15,7 +15,6 @@ function airutils.get_staticdata(self) -- unloaded/unloads ... is now saved
|
|||
stored_power_lever = self._power_lever,
|
||||
stored_driver_name = self.driver_name,
|
||||
stored_last_accell = self._last_accell,
|
||||
stored_engine_running = self._engine_running,
|
||||
stored_inv_id = self._inv_id,
|
||||
stored_flap = self._flap,
|
||||
stored_passengers = self._passengers,
|
||||
|
@ -41,7 +40,6 @@ function airutils.on_activate(self, staticdata, dtime_s)
|
|||
self._power_lever = data.stored_power_lever
|
||||
self.driver_name = data.stored_driver_name
|
||||
self._last_accell = data.stored_last_accell
|
||||
self._engine_running = data.stored_engine_running
|
||||
self._inv_id = data.stored_inv_id
|
||||
self._flap = data.stored_flap
|
||||
self._passengers = data.stored_passengers or {}
|
||||
|
|
|
@ -189,10 +189,16 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||
end
|
||||
if fields.go_out then
|
||||
local touch_point = ent.initial_properties.collisionbox[2]-1.0
|
||||
local touching_ground, liquid_below = airutils.check_node_below(plane_obj, touch_point)
|
||||
local is_on_ground = ent.isinliquid or touching_ground or liquid_below
|
||||
-----////
|
||||
local is_on_ground = false
|
||||
local pos = plane_obj:get_pos()
|
||||
pos.y = pos.y + touch_point
|
||||
local node_below = minetest.get_node(pos).name
|
||||
local nodedef = minetest.registered_nodes[node_below]
|
||||
is_on_ground = not nodedef or nodedef.walkable or false -- unknown nodes are solid
|
||||
|
||||
if ent.driver_name == name then
|
||||
--minetest.chat_send_all(dump(noded))
|
||||
if is_on_ground then --or clicker:get_player_control().sneak then
|
||||
--remove the passengers first
|
||||
local max_seats = table.getn(ent._seats)
|
||||
|
|
Loading…
Add table
Reference in a new issue