From 732a8cb88a94da2c3fb05317c51c088ab2180e4e Mon Sep 17 00:00:00 2001 From: trans_soup <> Date: Fri, 13 Oct 2023 08:30:25 +0200 Subject: [PATCH] tiny refactor. --- mods/bg_player/run.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/bg_player/run.lua b/mods/bg_player/run.lua index 46065c9..ad0846e 100644 --- a/mods/bg_player/run.lua +++ b/mods/bg_player/run.lua @@ -22,6 +22,7 @@ local function handle_speed (player, delta_time) data.duration = data.duration - delta_time * (slowdown_factor + 1) end if data.duration < 0 then data.duration = 0 end + if data.duration > walk_time + speedup_time then data.duration = walk_time + speedup_time end local duration = data.duration @@ -33,7 +34,6 @@ local function handle_speed (player, delta_time) else local run_time = duration - walk_time local t = run_time / speedup_time - if t > 1 then t = 1 end local factor = (run_factor - 1) * t + 1 if factor > run_factor then factor = run_factor end