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.
This commit is contained in:
Lazerbeak12345 2022-11-30 09:23:08 -07:00 committed by GitHub
parent fc16e60740
commit f14cf378ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,14 +87,12 @@ function vehicle_mash.register_vehicle(name, def)
lib_mount.detach(self.passenger3, self.offset) lib_mount.detach(self.passenger3, self.offset)
-- if clicker is not passenger -- if clicker is not passenger
else else
-- attach passengers if possible -- attach a passenger if possible
if lib_mount.passengers[self.passenger] == self.passenger and self.number_of_passengers >= 1 then if self.passenger==nil and self.number_of_passengers >= 1 then
lib_mount.attach(self, clicker, true, 1) lib_mount.attach(self, clicker, true, 1)
end elseif self.passenger2==nil and self.number_of_passengers >= 2 then
if lib_mount.passengers[self.passenger2] == self.passenger2 and self.number_of_passengers >= 2 then
lib_mount.attach(self, clicker, true, 2) lib_mount.attach(self, clicker, true, 2)
end elseif self.passenger3==nil and self.number_of_passengers >= 3 then
if lib_mount.passengers[self.passenger3] == self.passenger3 and self.number_of_passengers >= 3 then
lib_mount.attach(self, clicker, true, 3) lib_mount.attach(self, clicker, true, 3)
end end
end end