improved copilot attachment

This commit is contained in:
Alexsandro Percy 2023-07-13 21:40:40 -03:00
parent a252503f37
commit be2f9cccc2
2 changed files with 2 additions and 3 deletions

View file

@ -38,7 +38,7 @@ function airutils.on_activate(self, staticdata, dtime_s)
self.owner = data.stored_owner
self.hp_max = data.stored_hp
self._color = data.stored_color
self._color_2 = data.stored_color_2
self._color_2 = data.stored_color_2 or data.stored_color --if it has no color 2, now it have!
self._power_lever = data.stored_power_lever
self.driver_name = data.stored_driver_name
self._last_accell = data.stored_last_accell
@ -703,7 +703,6 @@ function airutils.on_rightclick(self, clicker)
--=========================
local is_attached = false
local seat = clicker:get_attach()
--TODO crar funcao legacy aqui
if seat then
local plane = seat:get_attach()
if plane == self.object then is_attached = true end

View file

@ -140,7 +140,7 @@ function airutils.attach_pax(self, player, is_copilot)
--randomize the seat
local max_seats = table.getn(self._seats)
local crew = 1
if self._have_copilot then crew = crew + 1 end
if self._have_copilot and max_seats > 2 then crew = crew + 1 end
t = {} -- new array
for i=1, max_seats - crew do --(the first are for the crew
t[i] = i