From: PatR Date: Sat, 5 Jun 2021 22:37:03 +0000 (-0700) Subject: fix pull request #527 - cursed levitation X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b8b95718d74b6e85cb03c992d5572f73c90ecf72;p=nethack fix pull request #527 - cursed levitation The stair handling reorganization changed drinking a cursed potion of levitation to only check whether stairs up existed on the level instead of whether the hero drank the potion while at their spot. That resulted in always attempting to go up and then getting "you can't go up here" when not at stairs instead of the intended "you hit your head on the ceiling". Fixes #527 --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 0af4b1b24..947c85f98 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -705,6 +705,8 @@ lighting for baalz level defaulted to random and could end up being lit when using 'O' to set menu color patterns, the reminder message that the boolean menucolors option needs to be set to True for them to work was sometimes given even when already True +stair revamp unintentionally resulted in cursed potion of levitation no longer + causing hero to hit head on ceiling curses: 'msg_window' option wasn't functional for curses unless the binary also included tty support diff --git a/src/potion.c b/src/potion.c index b9148f556..e23aa96f8 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1033,13 +1033,15 @@ peffects(struct obj *otmp) g.potion_nothing++; if (otmp->cursed) { + stairway *stway; + /* 'already levitating' used to block the cursed effect(s) aside from ~I_SPECIAL; it was not clear whether that was intentional; either way, it no longer does (as of 3.6.1) */ HLevitation &= ~I_SPECIAL; /* can't descend upon demand */ if (BLevitation) { ; /* rising via levitation is blocked */ - } else if (stairway_find_dir(TRUE)) { + } else if ((stway = stairway_at(u.ux, u.uy)) != 0 && stway->up) { (void) doup(); /* in case we're already Levitating, which would have resulted in incrementing 'nothing' */