diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-19 13:30:09 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-19 13:30:09 +0100 |
commit | f1da751349fb52a8a88b10bc3289288a4fcd2396 (patch) | |
tree | b9e3823bd3e2d9d57096c2fd6e6c30f9cf34f46c | |
parent | 9f8f42206b634a2df2feacabfd7f619ed5bc3a7d (diff) |
src/character: fix signed overflow in update
-rw-r--r-- | src/character.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/character.cpp b/src/character.cpp index 51c243c2..110d2031 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -78,7 +78,7 @@ int character::allocate_frame_time(float dt) constexpr int framerate_ = 65535/framerate; static_assert(framerate_ > 0); auto ret = d / framerate_; - delta = (uint16_t)std::clamp(d - ret*65535, 0, 65535); + delta = (uint16_t)std::clamp(d - ret*65535LL, 0LL, 65535LL); return ret; } |