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