summaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-12-02 16:36:11 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-12-02 16:37:41 +0000
commit826a380710261961eb339d12d44f1c45fc384131 (patch)
tree8864fc393373bb921ca46ed7bad9ae8405b9cb8e /game
parentExtend ray for intersect walk to cover the extents of the map (diff)
downloadilt-826a380710261961eb339d12d44f1c45fc384131.tar.bz2
ilt-826a380710261961eb339d12d44f1c45fc384131.tar.xz
ilt-826a380710261961eb339d12d44f1c45fc384131.zip
Handle the case where the ray never enters the map
Diffstat (limited to 'game')
-rw-r--r--game/geoData.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/game/geoData.cpp b/game/geoData.cpp
index 6c6f1df..e2b7f66 100644
--- a/game/geoData.cpp
+++ b/game/geoData.cpp
@@ -232,7 +232,11 @@ GeoData::walkUntil(const PointFace & from, const GlobalPosition2D to, const std:
{
auto f = from.face(this);
if (!f.is_valid()) {
- f = opposite_face_handle(findEntry(from.point, to));
+ const auto entryEdge = findEntry(from.point, to);
+ if (!entryEdge.is_valid()) {
+ return;
+ }
+ f = opposite_face_handle(entryEdge);
}
FaceHandle previousFace;
while (f.is_valid() && !op(f)) {