turns out timer duration can be a float

This commit is contained in:
Lilian Jónsdóttir 2020-08-02 14:02:27 -07:00
parent e0421fb64a
commit 6a3445e091

View file

@ -23,8 +23,8 @@ local function calculateFollowTime()
-- if player sneak is 100 or greater, guards won't follow at all -- if player sneak is 100 or greater, guards won't follow at all
local max = tes3.hasCodePatchFeature(110) and (sneak <= 100 and 101 or 0) or 101 local max = tes3.hasCodePatchFeature(110) and (sneak <= 100 and 101 or 0) or 101
local value = (max - sneak) / 3 local value = (max - sneak) / 3
-- round to nearest integer and clamp to positive -- clamp to positive
return math.clamp(math.round(value, 0), 0, math.huge) return math.clamp(value, 0, math.huge)
end end
local function doChecks(e) local function doChecks(e)