From dffd910115fb0b36310bb7b32ad0650727d58216 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Wed, 11 May 2016 07:49:18 -0400 Subject: clamp bug fix --- src/world.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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((e->loc.x + e->width / 2 - worldStart) / game::HLINE), 0, static_cast(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) { -- cgit v1.2.3