Small fixes

This commit is contained in:
ElCeejo 2022-09-28 15:11:17 -07:00
parent 0af4c2ba24
commit 7b3d55fef8
2 changed files with 6 additions and 6 deletions

10
api.lua
View file

@ -9,11 +9,11 @@ creatura.api = {}
local floor = math.floor
local random = math.random
local function clamp(val, min, max)
if val < min then
val = min
elseif max < val then
val = max
local function clamp(val, min_n, max_n)
if val < min_n then
val = min_n
elseif max_n < val then
val = max_n
end
return val
end

View file

@ -1167,7 +1167,7 @@ function mob:_vitals()
if on_ground then
damage = fall_start - pos.y
if damage < max_fall then
damage = nil
damage = 0
else
local resist = self.fall_resistance or 0
damage = damage - damage * resist