From f0bb13e17c9cf16b4bfe76e2b461a3294b5fd13c Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 12 Feb 2018 13:38:03 +0100 Subject: [PATCH] magic texture adjustment: fixed the algorithm --- textures.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/textures.cpp b/textures.cpp index a9bc78a2..a67427fd 100644 --- a/textures.cpp +++ b/textures.cpp @@ -596,7 +596,7 @@ void applyMagic() { bool failed = false; - for(ld delta = 1; delta > 1e-9; delta *= (failed ? -.7 : 1.2)) { + for(ld delta = 1; abs(delta) > 1e-9; delta *= (failed ? -.7 : 1.2)) { p.apply(delta); ld nq = magic_quality(); if(nq < cq) {