Slightly refactor level_tele level selection

This reorganization of the if/else chain for level selection is somewhat
cleaner and doesn't involve repeating the code for a Confusion "oops"
result.
This commit is contained in:
Michael Meyer
2023-10-27 17:24:17 -04:00
parent 72016b1f17
commit 4876b70b9b

View File

@@ -1152,17 +1152,13 @@ level_tele(void)
the previous input was invalid so don't use it
as getlin()'s preloaded default answer */
getlin(qbuf, buf);
if (!strcmp(buf, "\033")) { /* cancelled */
if (Confusion && rnl(5)) {
pline("Oops...");
goto random_levtport;
}
return;
} else if (!strcmp(buf, "*")) {
if (!strcmp(buf, "*")) {
goto random_levtport;
} else if (Confusion && rnl(5)) {
pline("Oops...");
goto random_levtport;
} else if (!strcmp(buf, "\033")) { /* cancelled */
return;
}
if (wizard && !strcmp(buf, "?")) {
schar destlev;