From b97666980e3fbb1a6d3550a5ce0789ada403a20b Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 21 Aug 2019 00:35:19 +0200 Subject: [PATCH] fixed a bug with radarpoints obscuring screen due to NaNs --- graph.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/graph.cpp b/graph.cpp index aa90c7ee..8072b240 100644 --- a/graph.cpp +++ b/graph.cpp @@ -2324,7 +2324,8 @@ bool applyAnimation(cell *c, transmatrix& V, double& footphase, int layer) { ld dist = d.first / R * aspd; if(abs(dist) > abs(d.first)) dist = -d.first; a.wherenow = mscale(a.wherenow, dist); - aspd *= sqrt(R*R - d.first * d.first) / R; + /* signed_sqrt to prevent precision errors */ + aspd *= signed_sqrt(R*R - d.first * d.first) / R; } a.wherenow = a.wherenow * rspintox(wnow); a.wherenow = a.wherenow * xpush(aspd);