improving impact

This commit is contained in:
Alexsandro Percy 2021-03-10 15:06:59 -03:00
parent 1b2d945fda
commit bdad7801d1

View File

@ -198,7 +198,7 @@ function trike.testImpact(self, velocity)
collision = false collision = false
if self.last_vel == nil then return end if self.last_vel == nil then return end
local impact = abs(trike.get_hipotenuse_value(velocity, self.last_vel)) local impact = abs(trike.get_hipotenuse_value(velocity, self.last_vel))
if impact > 1 then if impact > 2 then
--minetest.chat_send_all('impact: '.. impact .. ' - hp: ' .. self.hp_max) --minetest.chat_send_all('impact: '.. impact .. ' - hp: ' .. self.hp_max)
local p = self.object:get_pos() local p = self.object:get_pos()
local nodeu = mobkit.nodeatpos(mobkit.pos_shift(p,{y=1})) local nodeu = mobkit.nodeatpos(mobkit.pos_shift(p,{y=1}))