From 4876b70b9b68e3714b57ec4f36b5254962b9af82 Mon Sep 17 00:00:00 2001 From: Michael Meyer Date: Fri, 27 Oct 2023 17:24:17 -0400 Subject: [PATCH] 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. --- src/teleport.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/teleport.c b/src/teleport.c index 1f98f8b0c..b5637135c 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -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;