mirror of
https://github.com/APercy/airutils.git
synced 2025-03-15 08:01:22 +00:00
added updater for the seats
This commit is contained in:
parent
3a3ac1c36e
commit
9d49162b9d
2 changed files with 18 additions and 0 deletions
|
@ -227,6 +227,8 @@ function airutils.logic(self)
|
||||||
--test collision
|
--test collision
|
||||||
airutils.testImpact(self, velocity, curr_pos)
|
airutils.testImpact(self, velocity, curr_pos)
|
||||||
|
|
||||||
|
if ent._autoflymode == true then airutils.seats_update(self) end
|
||||||
|
|
||||||
if player then
|
if player then
|
||||||
local ctrl = player:get_player_control()
|
local ctrl = player:get_player_control()
|
||||||
---------------------
|
---------------------
|
||||||
|
|
|
@ -1068,6 +1068,22 @@ function airutils.seats_create(self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function airutils.seats_update(self)
|
||||||
|
if self.object then
|
||||||
|
local pos = self.object:get_pos()
|
||||||
|
if self._passengers_base then
|
||||||
|
local max_seats = table.getn(self._passengers_base)
|
||||||
|
for i=1, max_seats do
|
||||||
|
if not self._seats_rot then
|
||||||
|
self._passengers_base[i]:set_attach(self.object,'',self._seats[i],{x=0,y=0,z=0})
|
||||||
|
else
|
||||||
|
self._passengers_base[i]:set_attach(self.object,'',self._seats[i],{x=0,y=self._seats_rot[i],z=0})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
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._passengers_base)
|
||||||
for i=1, max_seats do
|
for i=1, max_seats do
|
||||||
|
|
Loading…
Add table
Reference in a new issue