diff options
-rw-r--r-- | src/transform_system.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/transform_system.cpp b/src/transform_system.cpp index b5e9b7c..ee392f1 100644 --- a/src/transform_system.cpp +++ b/src/transform_system.cpp | |||
@@ -94,7 +94,7 @@ CollisionResult TransformSystem::checkCollision(int spriteId, vec2i newLoc, Dire | |||
94 | } | 94 | } |
95 | 95 | ||
96 | if (!result.horiz.blocked) { | 96 | if (!result.horiz.blocked) { |
97 | auto it = rightCollidables_.lower_bound({oldColDR.x(), INT_MAX}); | 97 | auto it = rightCollidables_.lower_bound({oldColDR.x()+1, 0}); |
98 | for (; | 98 | for (; |
99 | (it != std::end(rightCollidables_) && | 99 | (it != std::end(rightCollidables_) && |
100 | std::get<0>(it->first) <= newColDR.x()); | 100 | std::get<0>(it->first) <= newColDR.x()); |
@@ -135,7 +135,7 @@ CollisionResult TransformSystem::checkCollision(int spriteId, vec2i newLoc, Dire | |||
135 | } | 135 | } |
136 | 136 | ||
137 | if (!result.horiz.blocked) { | 137 | if (!result.horiz.blocked) { |
138 | auto it = leftCollidables_.lower_bound({oldColUL.x(), 0}); | 138 | auto it = leftCollidables_.lower_bound({oldColUL.x()-1, INT_MAX}); |
139 | for (; | 139 | for (; |
140 | (it != std::end(leftCollidables_) && | 140 | (it != std::end(leftCollidables_) && |
141 | std::get<0>(it->first) >= newColUL.x()); | 141 | std::get<0>(it->first) >= newColUL.x()); |
@@ -176,7 +176,7 @@ CollisionResult TransformSystem::checkCollision(int spriteId, vec2i newLoc, Dire | |||
176 | } | 176 | } |
177 | 177 | ||
178 | if (!result.vert.blocked) { | 178 | if (!result.vert.blocked) { |
179 | auto it = downCollidables_.lower_bound({oldColDR.y(), INT_MAX}); | 179 | auto it = downCollidables_.lower_bound({oldColDR.y()+1, 0}); |
180 | for (; | 180 | for (; |
181 | (it != std::end(downCollidables_) && | 181 | (it != std::end(downCollidables_) && |
182 | std::get<0>(it->first) <= newColDR.y()); | 182 | std::get<0>(it->first) <= newColDR.y()); |
@@ -217,7 +217,7 @@ CollisionResult TransformSystem::checkCollision(int spriteId, vec2i newLoc, Dire | |||
217 | } | 217 | } |
218 | 218 | ||
219 | if (!result.vert.blocked) { | 219 | if (!result.vert.blocked) { |
220 | auto it = upCollidables_.lower_bound({oldColUL.y(), 0}); | 220 | auto it = upCollidables_.lower_bound({oldColUL.y()-1, INT_MAX}); |
221 | for (; | 221 | for (; |
222 | (it != std::end(upCollidables_) && | 222 | (it != std::end(upCollidables_) && |
223 | std::get<0>(it->first) >= newColUL.y()); | 223 | std::get<0>(it->first) >= newColUL.y()); |