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:
parent
a116878607
commit
8c1520c86c
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue