entry portal was on same level as bigroom or rogue level
gaining or losing strength while wearing gauntlets of power could give
misleading message about already being as strong or weak as possible
+levitation vs encumbrance message sequencing issues: putting on boots of
+ levitation reported reduction of encumbrance before finish-wearing
+ and float-up messages, taking off such boots didn't report increase
+ of encumbrance until player took another action
Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
-/* NetHack 3.6 extern.h $NHDT-Date: 1492733169 2017/04/21 00:06:09 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.586 $ */
+/* NetHack 3.6 extern.h $NHDT-Date: 1494107197 2017/05/06 21:46:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.587 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
E int NDECL(Armor_gone);
E int NDECL(Helmet_off);
E int NDECL(Gloves_off);
+E int NDECL(Boots_on);
E int NDECL(Boots_off);
E int NDECL(Cloak_off);
E int NDECL(Shield_off);
-/* NetHack 3.6 do_wear.c $NHDT-Date: 1455667557 2016/02/17 00:05:57 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.90 $ */
+/* NetHack 3.6 do_wear.c $NHDT-Date: 1494107204 2017/05/06 21:46:44 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.94 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
STATIC_DCL void FDECL(toggle_stealth, (struct obj *, long, BOOLEAN_P));
STATIC_DCL void FDECL(toggle_displacement, (struct obj *, long, BOOLEAN_P));
STATIC_PTR int NDECL(Armor_on);
-STATIC_PTR int NDECL(Boots_on);
+/* int NDECL(Boots_on); -- moved to extern.h */
STATIC_PTR int NDECL(Cloak_on);
STATIC_PTR int NDECL(Helmet_on);
STATIC_PTR int NDECL(Gloves_on);
* [Blindf_on() is an exception and calls setworn() itself.]
*/
-STATIC_PTR
int
Boots_on(VOID_ARGS)
{
context.takeoff.cancelled_don =
(afternmv == Boots_on || afternmv == Helmet_on
|| afternmv == Gloves_on || afternmv == Armor_on);
- afternmv = 0;
+ afternmv = (int NDECL((*))) 0;
nomovemsg = (char *) 0;
multi = 0;
context.takeoff.delay = 0;
-/* NetHack 3.6 hack.c $NHDT-Date: 1464485934 2016/05/29 01:38:54 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.168 $ */
+/* NetHack 3.6 hack.c $NHDT-Date: 1494107206 2017/05/06 21:46:46 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.174 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
/*
* Interrupt multi-turn putting on/taking off of armor (in which
* case we reached the sink due to being teleported while busy;
- * in 3.4.3, Boots_on()/Boots_off() [called via (*aftermv)() when
+ * in 3.4.3, Boots_on()/Boots_off() [called via (*afternmv)() when
* 'multi' reaches 0] triggered a crash if we were donning/doffing
* levitation boots [because the Boots_off() below causes 'uarmf'
- * to be null by the time 'aftermv' gets called]).
+ * to be null by the time 'afternmv' gets called]).
*
* Interrupt donning/doffing if we fall onto the sink, or if the
* code below is going to remove levitation boots even when we
nomovemsg = 0;
u.usleep = 0;
multi_reason = NULL;
- if (afternmv)
- (*afternmv)();
- afternmv = 0;
+ if (afternmv) {
+ int NDECL((*f)) = afternmv;
+ /* clear afternmv before calling it (to override the
+ encumbrance hack for levitation--see weight_cap()) */
+ afternmv = (int NDECL((*))) 0;
+ (void) (*f)();
+ }
}
STATIC_OVL void
int
weight_cap()
{
- register long carrcap;
+ long carrcap, save_ELev = ELevitation;
+
+ /* boots take multiple turns to wear but any properties they
+ confer are enabled at the start rather than the end; that
+ causes message sequencing issues for boots of levitation
+ so defer their encumbrance benefit until they're fully worn */
+ if (afternmv == Boots_on && (ELevitation & W_ARMF) != 0L) {
+ ELevitation &= ~W_ARMF;
+ float_vs_flight(); /* in case Levitation is blocking Flying */
+ }
carrcap = 25 * (ACURRSTR + ACURR(A_CON)) + 50;
if (Upolyd) {
if (carrcap < 0)
carrcap = 0;
}
+
+ if (ELevitation != save_ELev) {
+ ELevitation = save_ELev;
+ float_vs_flight();
+ }
+
return (int) carrcap;
}
-/* NetHack 3.6 trap.c $NHDT-Date: 1489745987 2017/03/17 10:19:47 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.277 $ */
+/* NetHack 3.6 trap.c $NHDT-Date: 1494107206 2017/05/06 21:46:46 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.278 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
if (Flying)
You("are no longer able to control your flight.");
BFlying |= I_SPECIAL;
+ /* levitation gives maximum carrying capacity, so encumbrance
+ state might be reduced */
+ (void) encumber_msg();
return;
}
BFlying &= ~I_SPECIAL;
if (Flying) {
You("have stopped levitating and are now flying.");
+ (void) encumber_msg(); /* carrying capacity might have changed */
return 1;
}
}
if (u.uswallow) {
You("float down, but you are still %s.",
is_animal(u.ustuck->data) ? "swallowed" : "engulfed");
+ (void) encumber_msg();
return 1;
}
}
}
+ /* levitation gives maximum carrying capacity, so having it end
+ potentially triggers greater encumbrance; do this after
+ 'come down' messages, before trap activation or autopickup */
+ (void) encumber_msg();
+
/* can't rely on u.uz0 for detecting trap door-induced level change;
it gets changed to reflect the new level before we can check it */
assign_level(¤t_dungeon_level, &u.uz);