From be2f9cccc2c6eb3dabc89576814d6f4236a0b296 Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Thu, 13 Jul 2023 21:40:40 -0300 Subject: [PATCH] improved copilot attachment --- lib_planes/entities.lua | 3 +-- lib_planes/utilities.lua | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib_planes/entities.lua b/lib_planes/entities.lua index eb53418..8943c15 100644 --- a/lib_planes/entities.lua +++ b/lib_planes/entities.lua @@ -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 diff --git a/lib_planes/utilities.lua b/lib_planes/utilities.lua index 4535bc0..75fab40 100644 --- a/lib_planes/utilities.lua +++ b/lib_planes/utilities.lua @@ -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