From 2b2cc4e8a9e81a6a08d13774e9748160bfe9206a Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 14 Mar 2024 20:19:27 +0100 Subject: [PATCH] in getNewLand, do not freeze if no land is valid --- landlock.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/landlock.cpp b/landlock.cpp index 078ed67b..1f05d66e 100644 --- a/landlock.cpp +++ b/landlock.cpp @@ -631,11 +631,13 @@ EX eLand getNewLand(eLand old) { if(ls::horodisk_structure() && tortoise::seek()) LIKELY tab[cnt++] = laTortoise; + int attempts = 0; eLand n = old; while(incompatible(n, old) || !isLandIngame(n)) { n = tab[hrand(cnt)]; if(weirdhyperbolic && specialland == laCrossroads4 && isCrossroads(n)) n = laCrossroads4; + attempts++; if(attempts == 2000) break; } return n;