From d0a85a68ab4f03dbb97293bbe998f40f15d44fcf Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Thu, 26 May 2022 19:42:39 -0300 Subject: [PATCH] math.abs --- utilities.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utilities.lua b/utilities.lua index 74ef455..59858a1 100755 --- a/utilities.lua +++ b/utilities.lua @@ -5,7 +5,7 @@ function steampunk_blimp.testDamage(self, velocity, position) local low_node_pos = -2.5 if self._last_vel == nil then return end --lets calculate the vertical speed, to avoid the bug on colliding on floor with hard lag - if abs(velocity.y - self._last_vel.y) > 2 then + if math.abs(velocity.y - self._last_vel.y) > 2 then local noded = mobkit.nodeatpos(mobkit.pos_shift(p,{y=low_node_pos})) if (noded and noded.drawtype ~= 'airlike') then collision = true @@ -15,7 +15,7 @@ function steampunk_blimp.testDamage(self, velocity, position) self.object:set_velocity(vector.add(velocity, vector.multiply(self._last_accell, self.dtime/8))) end end - local impact = abs(steampunk_blimp.get_hipotenuse_value(velocity, self._last_vel)) + local impact = math.abs(steampunk_blimp.get_hipotenuse_value(velocity, self._last_vel)) if impact > 2 then if self.colinfo then collision = self.colinfo.collides