diff options
Diffstat (limited to 'client/global.gd')
-rw-r--r-- | client/global.gd | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/client/global.gd b/client/global.gd index d02ce60c..d62f5413 100644 --- a/client/global.gd +++ b/client/global.gd @@ -374,9 +374,8 @@ static func interpolate(current, target, dt): static func interpolate_angle(current, target, dt): current = fmod(current, PI * 2) target = fmod(target, PI * 2) - if abs(target - current) > PI: - if target < 0: target += PI * 2 - else: target -= PI * 2 + if target - current > PI: target -= PI * 2 + elif current - target > PI: current -= PI * 2 return target + (current - target) * exp(-dt) # TODO not working in all cases yet but there was an attempt |