diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-23 13:32:00 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-23 13:32:00 +0100 |
commit | d5c8d7f79f877331925979f575022416229b163f (patch) | |
tree | 8b0041fb7728146a8f77060280c3fdfcb9df4e47 /src | |
parent | 2752606d3014e29eae4a522917b805d86b505400 (diff) |
w
Diffstat (limited to 'src')
-rw-r--r-- | src/critter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/critter.cpp b/src/critter.cpp index 318a5d53..d1f3caa7 100644 --- a/src/critter.cpp +++ b/src/critter.cpp @@ -197,7 +197,8 @@ void critter::update_movement(size_t i, const Ns& dt, rotation new_r) constexpr auto frac = (float{limits<Frac>::max}+1)/2; constexpr auto inv_frac = 1 / frac; const auto sign_vec = Math::sign(vec); - auto offset_ = vec + Vector2(offset_frac) * sign_vec * inv_frac; + const auto from_accum = Vector2(offset_frac) * sign_vec * inv_frac; + auto offset_ = vec + from_accum; auto off_i = Vector2i(offset_); if (!off_i.isZero()) { |