From f14cf378bac84f99bc0223726bff9dcf2f1096a2 Mon Sep 17 00:00:00 2001 From: Lazerbeak12345 Date: Wed, 30 Nov 2022 09:23:08 -0700 Subject: [PATCH] Fix incorrect passenger ordering (#11) This actually also fixes a bug where an infinite number of passengers could be mounted to the last passenger seat. --- framework.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/framework.lua b/framework.lua index 062ef49..5a9688a 100644 --- a/framework.lua +++ b/framework.lua @@ -87,14 +87,12 @@ function vehicle_mash.register_vehicle(name, def) lib_mount.detach(self.passenger3, self.offset) -- if clicker is not passenger else - -- attach passengers if possible - if lib_mount.passengers[self.passenger] == self.passenger and self.number_of_passengers >= 1 then + -- attach a passenger if possible + if self.passenger==nil and self.number_of_passengers >= 1 then lib_mount.attach(self, clicker, true, 1) - end - if lib_mount.passengers[self.passenger2] == self.passenger2 and self.number_of_passengers >= 2 then + elseif self.passenger2==nil and self.number_of_passengers >= 2 then lib_mount.attach(self, clicker, true, 2) - end - if lib_mount.passengers[self.passenger3] == self.passenger3 and self.number_of_passengers >= 3 then + elseif self.passenger3==nil and self.number_of_passengers >= 3 then lib_mount.attach(self, clicker, true, 3) end end