mirror of
https://github.com/APercy/ap_airship.git
synced 2025-03-15 07:51:20 +00:00
improved ship dettach
This commit is contained in:
parent
060b2fac5b
commit
5c81cc7858
2 changed files with 5 additions and 4 deletions
|
@ -256,8 +256,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
-- dettach player
|
-- dettach player
|
||||||
--=========================
|
--=========================
|
||||||
-- eject passenger if the plane is on ground
|
-- eject passenger if the plane is on ground
|
||||||
ent.driver_name = nil
|
|
||||||
ent._at_control = false
|
|
||||||
|
|
||||||
ap_airship.dettach_pax(ent, player, "l")
|
ap_airship.dettach_pax(ent, player, "l")
|
||||||
|
|
||||||
|
@ -267,8 +265,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
-- dettach player
|
-- dettach player
|
||||||
--=========================
|
--=========================
|
||||||
-- eject passenger if the plane is on ground
|
-- eject passenger if the plane is on ground
|
||||||
ent.driver_name = nil
|
|
||||||
ent._at_control = false
|
|
||||||
|
|
||||||
ap_airship.dettach_pax(ent, player, "r")
|
ap_airship.dettach_pax(ent, player, "r")
|
||||||
|
|
||||||
|
|
|
@ -185,6 +185,11 @@ function ap_airship.dettach_pax(self, player, side)
|
||||||
if not self._passengers then return end
|
if not self._passengers then return end
|
||||||
if player then
|
if player then
|
||||||
local name = player:get_player_name() --self._passenger
|
local name = player:get_player_name() --self._passenger
|
||||||
|
if self.driver_name == name then
|
||||||
|
self.driver_name = nil
|
||||||
|
self._at_control = false
|
||||||
|
end
|
||||||
|
|
||||||
ap_airship.remove_hud(player)
|
ap_airship.remove_hud(player)
|
||||||
|
|
||||||
-- passenger clicked the object => driver gets off the vehicle
|
-- passenger clicked the object => driver gets off the vehicle
|
||||||
|
|
Loading…
Add table
Reference in a new issue