tiny refactor.
This commit is contained in:
parent
3c25192944
commit
732a8cb88a
1 changed files with 1 additions and 1 deletions
|
@ -22,6 +22,7 @@ local function handle_speed (player, delta_time)
|
||||||
data.duration = data.duration - delta_time * (slowdown_factor + 1)
|
data.duration = data.duration - delta_time * (slowdown_factor + 1)
|
||||||
end
|
end
|
||||||
if data.duration < 0 then data.duration = 0 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
|
local duration = data.duration
|
||||||
|
|
||||||
|
@ -33,7 +34,6 @@ local function handle_speed (player, delta_time)
|
||||||
else
|
else
|
||||||
local run_time = duration - walk_time
|
local run_time = duration - walk_time
|
||||||
local t = run_time / speedup_time
|
local t = run_time / speedup_time
|
||||||
if t > 1 then t = 1 end
|
|
||||||
|
|
||||||
local factor = (run_factor - 1) * t + 1
|
local factor = (run_factor - 1) * t + 1
|
||||||
if factor > run_factor then factor = run_factor end
|
if factor > run_factor then factor = run_factor end
|
||||||
|
|
Loading…
Reference in a new issue