fix crash on destruction

This commit is contained in:
Alexsandro Percy 2024-03-30 07:19:10 -03:00
parent fad724b479
commit ad7a644355

View file

@ -1133,9 +1133,11 @@ function airutils.seats_update(self)
end end
function airutils.seats_destroy(self) function airutils.seats_destroy(self)
local max_seats = table.getn(self._passengers_base) local max_seats = table.getn(self._seats)
for i=1, max_seats do for i=1, max_seats do
if self._passengers_base[i] then self._passengers_base[i]:remove() end if self._passengers_base and self._passengers_base[i] then
if self._passengers_base[i] ~= 0 then self._passengers_base[i]:remove() end
end
end end
end end