summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-02-26 17:38:02 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-02-26 18:04:44 +0100
commitb0d4770710d129d58ecaa67f6ac11f2a02cad8d6 (patch)
tree892f97b4e782042e6108315192cff390a719346f /src
parent590f120ced72b37eb6fd85b89e33a9d4b11c6f2c (diff)
fix a warning
Diffstat (limited to 'src')
-rw-r--r--src/raycast.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/raycast.cpp b/src/raycast.cpp
index 598797eb..b4d64a85 100644
--- a/src/raycast.cpp
+++ b/src/raycast.cpp
@@ -104,8 +104,8 @@ constexpr bool within_chunk_bounds(Math::Vector2<T> p0, Math::Vector2<T> p1)
constexpr auto half_bb = (max_bb_size + Math::Vector2{T{1}}) / T{2};
constexpr auto start = -half_bb, end = chunk_size<T> + half_bb;
- return !(start.x() > p1.x() || end.x() < p0.x() ||
- start.y() > p1.y() || end.y() < p0.y());
+ return start.x() <= p1.x() && end.x() >= p0.x() &&
+ start.y() <= p1.y() && end.y() >= p0.y();
}
template bool within_chunk_bounds<int>(Math::Vector2<int> p0, Math::Vector2<int> p1);