1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-07-29 00:42:28 +01:00

Don't rely on RNG to avoid panic()ing

This commit is contained in:
NeroOneTrueKing 2021-12-28 11:18:31 -06:00
parent a116878607
commit 8c1520c86c

View file

@ -1268,6 +1268,14 @@ u_on_sstairs() { /* place you on the special staircase */
return;
}
} while (++trycnt <= 500);
/* try extra hard to place player */
for (x=1; x <= COLNO-1; x++)
for (y=0; y <= ROWNO-1; y++)
if (!badspot(x, y)) {
u_on_newpos(x, y);
return;
}
panic("u_on_sstairs: could not relocate player!");
#undef badspot
}