diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2016-05-11 07:49:18 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2016-05-11 07:49:18 -0400 |
commit | dffd910115fb0b36310bb7b32ad0650727d58216 (patch) | |
tree | 8356bde5ceedf93e24a1078dd8112028a7f76ce6 /src/world.cpp | |
parent | a9abee3d7b57a094358ffbb460799d70fed7ef8b (diff) |
clamp bug fix
Diffstat (limited to 'src/world.cpp')
-rw-r--r-- | src/world.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/world.cpp b/src/world.cpp index 8c3d2f8..4fe2743 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -747,7 +747,7 @@ singleDetect(Entity *e) e->handleHits(); // calculate the line that this entity is currently standing on - l = std::clamp(static_cast<int>((e->loc.x + e->width / 2 - worldStart) / game::HLINE), 0, static_cast<int>(lineCount - 1)); + l = (e->loc.x + e->width / 2 - worldStart) / game::HLINE; // if the entity is under the world/line, pop it back to the surface if (e->loc.y < worldData[l].groundHeight) { |