1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-02-03 20:59:17 +00:00

Check for having pruned all land candidates.

This commit is contained in:
Jacob Mandelson 2024-05-16 12:46:06 -07:00
parent cd2152ffad
commit 11837d9614

View File

@ -675,7 +675,6 @@ EX eLand getNewLand(eLand old) {
if(ls::horodisk_structure() && tortoise::seek()) LIKELY tab[cnt++] = laTortoise; if(ls::horodisk_structure() && tortoise::seek()) LIKELY tab[cnt++] = laTortoise;
printf("Before pruning: %d entries\n", cnt);
int idx = 0; int idx = 0;
while (idx < cnt) { while (idx < cnt) {
eLand n = tab[idx]; eLand n = tab[idx];
@ -684,14 +683,16 @@ EX eLand getNewLand(eLand old) {
else else
idx++; idx++;
} }
printf("After pruning: %d entries\n", cnt);
if (!cnt) {
addMessage("No eligible land candidates!");
return old;
}
eLand n = tab[hrand(cnt)]; eLand n = tab[hrand(cnt)];
if (weirdhyperbolic && specialland == laCrossroads4 && isCrossroads(n)) if (weirdhyperbolic && specialland == laCrossroads4 && isCrossroads(n))
n = laCrossroads4; n = laCrossroads4;
//printf("Took %d attempts.\n", attempts);
return n; return n;
} }