mirror of
https://github.com/APercy/airutils.git
synced 2025-08-24 02:17:21 -04:00
improved vehicle destruction code
This commit is contained in:
parent
758ce12162
commit
59f4865a07
3 changed files with 8 additions and 0 deletions
|
@ -7,6 +7,7 @@ function airutils.physics(self)
|
|||
local surface = nil
|
||||
local surfnodename = nil
|
||||
local spos = airutils.get_stand_pos(self)
|
||||
if not spos then return end
|
||||
spos.y = spos.y+0.01
|
||||
-- get surface height
|
||||
local snodepos = airutils.get_node_pos(spos)
|
||||
|
|
|
@ -119,6 +119,10 @@ function airutils.on_step(self,dtime,colinfo)
|
|||
end
|
||||
end
|
||||
|
||||
if self.hp_max <= 0 then
|
||||
airutils.destroy(self)
|
||||
end
|
||||
|
||||
self:physics()
|
||||
|
||||
if self.logic then
|
||||
|
@ -214,6 +218,7 @@ function airutils.logic(self)
|
|||
end
|
||||
end
|
||||
|
||||
if not self.object:get_acceleration() then return end
|
||||
local accel_y = self.object:get_acceleration().y
|
||||
local rotation = self.object:get_rotation()
|
||||
local yaw = rotation.y
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue