mirror of
https://github.com/APercy/airutils.git
synced 2025-03-15 00:01:20 +00:00
fix crash on destruction
This commit is contained in:
parent
fad724b479
commit
ad7a644355
1 changed files with 4 additions and 2 deletions
|
@ -1133,9 +1133,11 @@ function airutils.seats_update(self)
|
|||
end
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue