-$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.69 $ $NHDT-Date: 1579261284 2020/01/17 11:41:24 $
+$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.70 $ $NHDT-Date: 1579649788 2020/01/21 23:36:28 $
General Fixes and Modified Features
-----------------------------------
confused about whether autopickup would occur so could be misleading
random role selection wasn't honoring unwanted alignment(s) properly
if at the edge of the map window, trying to move farther fails but used a turn
+hero can no longer wear blindfold/towel/lenses when poly'd into headless form
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
-/* NetHack 3.6 do_wear.c $NHDT-Date: 1575768410 2019/12/08 01:26:50 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.126 $ */
+/* NetHack 3.6 do_wear.c $NHDT-Date: 1579649788 2020/01/21 23:36:28 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.127 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
Blindf_off(otmp)
struct obj *otmp;
{
- boolean was_blind = Blind, changed = FALSE;
+ boolean was_blind = Blind, changed = FALSE,
+ nooffmsg = !otmp;
+ if (!otmp)
+ otmp = ublindf;
if (!otmp) {
- impossible("Blindf_off without otmp");
+ impossible("Blindf_off without eyewear?");
return;
}
g.context.takeoff.mask &= ~W_TOOL;
setworn((struct obj *) 0, otmp->owornmask);
- off_msg(otmp);
+ if (!nooffmsg)
+ off_msg(otmp);
if (Blind) {
if (was_blind) {
return 1;
}
} else {
+ /*
+ * FIXME:
+ * except for the rings/nolimbs case, this allows you to put on
+ * accessories without having any hands to manipulate them, and
+ * to put them on when poly'd into a tiny or huge form where
+ * they shouldn't fit. [If the latter situation changes, make
+ * comparable change to break_armor(polyself.c).]
+ */
+
/* accessory */
if (ring) {
char answer, qbuf[QBUFSZ];
return 0;
}
} else if (eyewear) {
+ if (!has_head(g.youmonst.data)) {
+ You("have no head to wear %s on.", ansimpleoname(obj));
+ return 0;
+ }
+
if (ublindf) {
if (ublindf->otyp == TOWEL)
Your("%s is already covered by a towel.",
-/* NetHack 3.6 polyself.c $NHDT-Date: 1573290419 2019/11/09 09:06:59 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.135 $ */
+/* NetHack 3.6 polyself.c $NHDT-Date: 1579649789 2020/01/21 23:36:29 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.148 $ */
/* Copyright (C) 1987, 1988, 1989 by Ken Arromdee */
/* NetHack may be freely redistributed. See license for details. */
useup(uarmu);
}
} else if (sliparm(g.youmonst.data)) {
- if (((otmp = uarm) != 0) && (racial_exception(&g.youmonst, otmp) < 1)) {
+ if ((otmp = uarm) != 0 && racial_exception(&g.youmonst, otmp) < 1) {
if (donning(otmp))
cancel_don();
Your("armor falls around you!");
dropp(otmp);
}
}
+ /* not armor, but eyewear shouldn't stay worn without a head to wear
+ it/them on (should also come off if head is too tiny or too huge,
+ but putting accessories on doesn't reject those cases [yet?]);
+ amulet stays worn */
+ if ((otmp = ublindf) != 0 && !has_head(g.youmonst.data)) {
+ int l;
+ const char *eyewear = simpleonames(otmp); /* blindfold|towel|lenses */
+
+ if (!strncmp(eyewear, "pair of ", l = 8)) /* lenses */
+ eyewear += l;
+ Your("%s %s off!", eyewear, vtense(eyewear, "fall"));
+ (void) Blindf_off((struct obj *) 0); /* Null: skip usual off mesg */
+ dropp(otmp);
+ }
+ /* rings stay worn even when no hands */
}
static void