diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 5944b188e..fb9527610 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -959,6 +959,8 @@ a hero on the quest home level who runs or travels past the quest leader and gets tossed out of the quest for some reason would keep running on the far side of the quest portal allow rush/run over water if wearing discovered water walking boots +wearing water walking boots while underwater (maybe via magical breathing) + and rising to surface wasn't causing the boots to become discovered flying pets wouldn't target underwater food but if they happened to fly over such food they could and would eat it praying on an altar with pet corpse on it can revive the pet diff --git a/include/decl.h b/include/decl.h index fb444cbf6..2d2aabef9 100644 --- a/include/decl.h +++ b/include/decl.h @@ -1044,6 +1044,9 @@ struct instance_globals_w { int warn_obj_cnt; /* count of monsters meeting criteria */ long wailmsg; + /* do_wear.c */ + uint8 wasinwater; + /* symbols.c */ nhsym warnsyms[WARNCOUNT]; /* the current warning display symbols */ diff --git a/src/decl.c b/src/decl.c index e21cfc8db..31d1baa8c 100644 --- a/src/decl.c +++ b/src/decl.c @@ -851,6 +851,8 @@ static const struct instance_globals_w g_init_w = { /* decl.c */ 0, /* warn_obj_cnt */ 0L, /* wailmsg */ + /* do_wear.c */ + 0U, /* symbols.c */ DUMMY, /* warnsyms */ /* files.c */ diff --git a/src/do_wear.c b/src/do_wear.c index 977b51846..0655cc764 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -196,8 +196,22 @@ Boots_on(void) case KICKING_BOOTS: break; case WATER_WALKING_BOOTS: + /* + * Sequencing issue? If underwater (perhaps via magical breathing), + * putting on water walking boots produces "you slowly rise above + * the surface" then "you finish your dressing maneuver". + */ + + /* spoteffects() doesn't get called here; pooleffects() is called + during movement and u.uinwater is already False after setworn() */ if (u.uinwater) spoteffects(TRUE); + /* init'd in accessory_or_armor_on() and only used here */ + if (gw.wasinwater) { + if (!u.uinwater) + makeknown(WATER_WALKING_BOOTS); + gw.wasinwater = 0U; + } /* (we don't need a lava check here since boots can't be put on while feet are stuck) */ break; @@ -2338,6 +2352,7 @@ accessory_or_armor_on(struct obj *obj) * obj->known = 1; */ + gw.wasinwater = u.uinwater; /* for WWALKING; Boots_on() is too late */ setworn(obj, mask); /* if there's no delay, we'll execute 'afternmv' immediately */ if (obj == uarm) @@ -2367,6 +2382,8 @@ accessory_or_armor_on(struct obj *obj) on_msg(obj); } svc.context.takeoff.mask = svc.context.takeoff.what = 0L; + /* gw.wasinwater = 0U; // can't clear this yet; Boots_on() needs it + * and gets called via afternmv() after this routine has returned */ } else { /* not armor */ if (ring) { /* Ring_on() expects ring to already be worn as uleft or uright */