From 89f7d5c94801077c6cfcdf40ca0ff04a9be01487 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Thu, 1 Mar 2018 23:19:27 +0000 Subject: [PATCH] I think this should return 1, not 0. Like this, I can loop over the column/row facing the collision side, ie for z = tile; z < tile + len. --- src/gamelib/collider.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gamelib/collider.cpp b/src/gamelib/collider.cpp index 7ae37f7..14613bb 100644 --- a/src/gamelib/collider.cpp +++ b/src/gamelib/collider.cpp @@ -34,8 +34,8 @@ namespace curry { vec2us check_tiles_count (const vec2us& parObjSize, const vec2f& parDirection) { assert(parObjSize > 0); - const uint16_t horz = (parDirection.y() != 0.0f ? parObjSize.x() : 0); - const uint16_t vert = (parDirection.x() != 0.0f ? parObjSize.y() : 0); + const uint16_t horz = (parDirection.y() != 0.0f ? parObjSize.x() : 1); + const uint16_t vert = (parDirection.x() != 0.0f ? parObjSize.y() : 1); return vec2us(horz, vert); }