fix of driver error

This commit is contained in:
Alexsandro Percy 2023-12-27 15:14:25 -03:00
parent 04e19cb5dc
commit e5f7682ee3

View File

@ -108,7 +108,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end end
if fields.take then if fields.take then
ent._at_control = true ent._at_control = true
for i = 5,1,-1 for i = #ap_airship.passenger_pos,1,-1
do do
if ent._passengers[i] == name then if ent._passengers[i] == name then
ent._passengers_base_pos[i] = vector.new(ap_airship.pilot_base_pos) ent._passengers_base_pos[i] = vector.new(ap_airship.pilot_base_pos)
@ -180,7 +180,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if fields.take_control == "true" then if fields.take_control == "true" then
if ent.driver_name == nil or ent.driver_name == "" then if ent.driver_name == nil or ent.driver_name == "" then
ent._at_control = true ent._at_control = true
for i = 5,1,-1 for i = #ap_airship.passenger_pos,1,-1
do do
if ent._passengers[i] == name then if ent._passengers[i] == name then
ent._passengers_base_pos[i] = vector.new(ap_airship.pilot_base_pos) ent._passengers_base_pos[i] = vector.new(ap_airship.pilot_base_pos)
@ -448,7 +448,7 @@ minetest.register_chatcommand("airship_eject", {
local entity = seat:get_luaentity() local entity = seat:get_luaentity()
if entity then if entity then
if entity.name == "ap_airship:airship" then if entity.name == "ap_airship:airship" then
for i = 5,1,-1 for i = #ap_airship.passenger_pos,1,-1
do do
if entity._passengers[i] == name then if entity._passengers[i] == name then
ap_airship.dettach_pax(entity, player, "l") ap_airship.dettach_pax(entity, player, "l")