in getNewLand, do not freeze if no land is valid

This commit is contained in:
Zeno Rogue 2024-03-14 20:19:27 +01:00
parent cbccf4936d
commit 2b2cc4e8a9
1 changed files with 2 additions and 0 deletions

View File

@ -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;