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
This commit is contained in:
PatR
2021-06-05 15:37:03 -07:00
parent 60cc48890b
commit b8b95718d7
2 changed files with 5 additions and 1 deletions
+2
View File
@@ -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 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 boolean menucolors option needs to be set to True for them to work
was sometimes given even when already True 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 curses: 'msg_window' option wasn't functional for curses unless the binary
also included tty support also included tty support
+3 -1
View File
@@ -1033,13 +1033,15 @@ peffects(struct obj *otmp)
g.potion_nothing++; g.potion_nothing++;
if (otmp->cursed) { if (otmp->cursed) {
stairway *stway;
/* 'already levitating' used to block the cursed effect(s) /* 'already levitating' used to block the cursed effect(s)
aside from ~I_SPECIAL; it was not clear whether that was aside from ~I_SPECIAL; it was not clear whether that was
intentional; either way, it no longer does (as of 3.6.1) */ intentional; either way, it no longer does (as of 3.6.1) */
HLevitation &= ~I_SPECIAL; /* can't descend upon demand */ HLevitation &= ~I_SPECIAL; /* can't descend upon demand */
if (BLevitation) { if (BLevitation) {
; /* rising via levitation is blocked */ ; /* 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(); (void) doup();
/* in case we're already Levitating, which would have /* in case we're already Levitating, which would have
resulted in incrementing 'nothing' */ resulted in incrementing 'nothing' */