From 12dcd348b07f686e319f5bea22da065e2eb3c13c Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 7 Nov 2021 09:59:22 +0100 Subject: [PATCH] sol:: stop crashing if coordinates are NAN --- nonisotropic.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nonisotropic.cpp b/nonisotropic.cpp index 8d34b4b5..f223ae48 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -105,14 +105,15 @@ EX namespace sn { hyperpoint res; if(lazy) { + if(isnan(ix) || isnan(iy) || isnan(iz)) return Hypc; return decompress(get_int(int(ix+.5), int(iy+.5), int(iz+.5))); } else { - if(ix >= PRECX-1) ix = PRECX-2; - if(iy >= PRECX-1) iy = PRECX-2; - if(iz >= PRECZ-1) iz = PRECZ-2; + if(ix >= PRECX-1 || isnan(ix)) ix = PRECX-2; + if(iy >= PRECX-1 || isnan(iy)) iy = PRECX-2; + if(iz >= PRECZ-1 || isnan(iz)) iz = PRECZ-2; int ax = ix, bx = ax+1; int ay = iy, by = ay+1;