diff --git a/src/gamelib/grid_raytrace.cpp b/src/gamelib/grid_raytrace.cpp index 8273fde..28aa2a0 100644 --- a/src/gamelib/grid_raytrace.cpp +++ b/src/gamelib/grid_raytrace.cpp @@ -138,10 +138,12 @@ namespace curry { const vec2us last_tile = pixel_to_world_tile(parWorld, parTo); while (parFunc(curr_tile) and last_tile != curr_tile) { if (max.x() < max.y()) { + assert(std::max(static_cast(curr_tile.x() + step.x()), last_tile.x()) - std::min(static_cast(curr_tile.x() + step.x()), last_tile.x()) < std::max(curr_tile.x(), last_tile.x()) - std::min(curr_tile.x(), last_tile.x())); max.x() += delta.x(); curr_tile.x() = static_cast(curr_tile.x() + step.x()); } else { + assert(std::max(static_cast(curr_tile.y() + step.y()), last_tile.y()) - std::min(static_cast(curr_tile.y() + step.y()), last_tile.y()) < std::max(curr_tile.y(), last_tile.y()) - std::min(curr_tile.y(), last_tile.y())); max.y() += delta.y(); curr_tile.y() = static_cast(curr_tile.y() + step.y()); }