Merge pull request #62 from Poikilos/patch-1
Detect if the object is dying rather than dead.
This commit is contained in:
commit
f90443761a
4
api.lua
4
api.lua
@ -737,9 +737,9 @@ function vehicles.explodinate(ent, radius)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function vehicles.on_punch(self, puncher)
|
function vehicles.on_punch(self, puncher, time_from_last_punch, tool_capabilities, direction, damage)
|
||||||
local hp = self.object:get_hp()
|
local hp = self.object:get_hp()
|
||||||
if hp == 0 then
|
if (hp - damage) < 1 then
|
||||||
if self.driver then
|
if self.driver then
|
||||||
vehicles.object_detach(self, self.driver, {x=1, y=0, z=1})
|
vehicles.object_detach(self, self.driver, {x=1, y=0, z=1})
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user