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 floor = math.floor
local random = math.random local random = math.random
local function clamp(val, min, max) local function clamp(val, min_n, max_n)
if val < min then if val < min_n then
val = min val = min_n
elseif max < val then elseif max_n < val then
val = max val = max_n
end end
return val return val
end end

View file

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