-$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.34 $ $NHDT-Date: 1559664948 2019/06/04 16:15:48 $
+$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.35 $ $NHDT-Date: 1559670600 2019/06/04 17:50:00 $
This fixes36.3 file is here to capture information about updates in the 3.6.x
lineage following the release of 3.6.2 in May 2019. Please note, however,
green slime) then die again due to green slimes having been genocided,
the feedback was strange because it assumed that the prior message
came from answering No to "Really die?" in explore or wizard mode
+various cases where objects had their bless/curse state become known weren't
+ updating persistent inventory window, when enabled, to reflect changes
+ (cited case was trying to remove cursed armor and being told of the
+ curse but there were lots of other situations with the same issue)
Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository
-/* NetHack 3.6 extern.h $NHDT-Date: 1559601014 2019/06/03 22:30:14 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.708 $ */
+/* NetHack 3.6 extern.h $NHDT-Date: 1559670600 2019/06/04 17:50:00 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.709 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
E void FDECL(curse, (struct obj *));
E void FDECL(uncurse, (struct obj *));
E void FDECL(blessorcurse, (struct obj *, int));
+E void FDECL(set_bknown, (struct obj *, unsigned));
E boolean FDECL(is_flammable, (struct obj *));
E boolean FDECL(is_rottable, (struct obj *));
E void FDECL(place_object, (struct obj *, int, int));
-/* NetHack 3.6 apply.c $NHDT-Date: 1553363415 2019/03/23 17:50:15 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.272 $ */
+/* NetHack 3.6 apply.c $NHDT-Date: 1559670602 2019/06/04 17:50:02 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.274 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
pline("This leash is not attached to that creature.");
} else if (obj->cursed) {
pline_The("leash would not come off!");
- obj->bknown = 1;
+ set_bknown(obj, 1);
} else {
mtmp->mleashed = 0;
obj->leashmon = 0;
pline("%s welded to %s %s%c",
(otmp->quan == 1L) ? "It is" : "They are", mhis(mtmp),
mon_hand, !otmp->bknown ? '!' : '.');
- otmp->bknown = 1;
+ set_bknown(otmp, 1);
gotit = FALSE; /* can't pull it free */
}
if (gotit) {
if (!rn2(49)) {
if (!Blind) {
pline("%s %s.", Yobjnam2(obj, "glow"), hcolor("brown"));
- obj->bknown = 1;
+ set_bknown(obj, 1);
}
unbless(obj);
}
-/* NetHack 3.6 do.c $NHDT-Date: 1559299314 2019/05/31 10:41:54 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.191 $ */
+/* NetHack 3.6 do.c $NHDT-Date: 1559670603 2019/06/04 17:50:03 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.192 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
an(hcolor(obj->blessed ? NH_AMBER : NH_BLACK)), doname(obj),
otense(obj, "hit"));
if (!Hallucination)
- obj->bknown = 1;
+ obj->bknown = 1; /* ok to bypass set_bknown() */
} else {
pline("%s %s on the altar.", Doname2(obj), otense(obj, "land"));
if (obj->oclass != COIN_CLASS)
- obj->bknown = 1;
+ obj->bknown = 1; /* ok to bypass set_bknown() */
}
}
obj->corpsenm ? " any of" : "", plur(obj->quan));
}
obj->corpsenm = 0; /* reset */
- obj->bknown = 1;
+ set_bknown(obj, 1);
return FALSE;
}
if (obj->otyp == LEASH && obj->leashmon != 0) {
-/* NetHack 3.6 do_wear.c $NHDT-Date: 1551138255 2019/02/25 23:44:15 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.108 $ */
+/* NetHack 3.6 do_wear.c $NHDT-Date: 1559670603 2019/06/04 17:50:03 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.109 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
/* Check if something worn is cursed _and_ unremovable. */
int
cursed(otmp)
-register struct obj *otmp;
+struct obj *otmp;
{
if (!otmp) {
impossible("cursed without otmp");
|| otmp->otyp == LENSES || otmp->quan > 1L);
You("can't. %s cursed.", use_plural ? "They are" : "It is");
- otmp->bknown = TRUE;
+ set_bknown(otmp, 1);
return 1;
}
return 0;
int
armoroff(otmp)
-register struct obj *otmp;
+struct obj *otmp;
{
register int delay = -objects[otmp->otyp].oc_delay;
}
if (uarmg && uarmg->cursed) {
res = !uarmg->bknown;
- uarmg->bknown = 1;
+ set_bknown(uarmg, 1);
You("cannot remove your gloves to put on the ring.");
return res; /* uses move iff we learned gloves are cursed */
}
}
if (why) {
You("cannot %s to remove the ring.", buf);
- why->bknown = TRUE;
+ set_bknown(why, 1);
return 0;
}
}
if (welded(uwep)) {
You("are unable to take off your %s while wielding that %s.",
c_gloves, is_sword(uwep) ? c_sword : c_weapon);
- uwep->bknown = TRUE;
+ set_bknown(uwep, 1);
return 0;
} else if (Glib) {
You_cant("take off the slippery %s with your slippery %s.",
}
if (why) {
You("cannot %s to take off %s.", buf, the(xname(otmp)));
- why->bknown = TRUE;
+ set_bknown(why, 1);
return 0;
}
}
-/* NetHack 3.6 eat.c $NHDT-Date: 1542765357 2018/11/21 01:55:57 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.197 $ */
+/* NetHack 3.6 eat.c $NHDT-Date: 1559670604 2019/06/04 17:50:04 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.202 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
* against the possibility just in case.
*/
if (welded(otmp) || (otmp->cursed && (otmp->owornmask & W_RING))) {
- otmp->bknown = 1; /* for ring; welded() does this for weapon */
+ set_bknown(otmp, 1); /* for ring; welded() does this for weapon */
You("spit out %s.", the(xname(otmp)));
} else {
You("spit %s out onto the %s.", the(xname(otmp)),
-/* NetHack 3.6 files.c $NHDT-Date: 1546144856 2018/12/30 04:40:56 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.249 $ */
+/* NetHack 3.6 files.c $NHDT-Date: 1559670605 2019/06/04 17:50:05 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.250 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
/* subset of starting inventory pre-ID */
obj->dknown = 1;
if (Role_if(PM_PRIEST))
- obj->bknown = 1;
+ obj->bknown = 1; /* ok to bypass set_bknown() */
/* same criteria as lift_object()'s check for available inventory slot */
if (obj->oclass != COIN_CLASS && inv_cnt(FALSE) >= 52
&& !merge_choice(invent, obj)) {
-/* NetHack 3.6 mkobj.c $NHDT-Date: 1559476922 2019/06/02 12:02:02 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.149 $ */
+/* NetHack 3.6 mkobj.c $NHDT-Date: 1559670606 2019/06/04 17:50:06 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.150 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
{
xchar ox, oy;
char objroom;
- boolean set_bknown;
+ boolean learn_bknown;
const char *those, *them;
struct monst *shkp = 0;
/* when shopkeeper describes the object as being uncursed or unblessed
hero will know that it is now uncursed; will also make the feedback
from `I x' after bill_dummy_object() be more specific for this item */
- set_bknown = (alter_type == COST_UNCURS || alter_type == COST_UNBLSS);
+ learn_bknown = (alter_type == COST_UNCURS || alter_type == COST_UNBLSS);
switch (obj->where) {
case OBJ_FREE: /* obj_no_longer_held() */
case OBJ_INVENT:
- if (set_bknown)
- obj->bknown = 1;
+ if (learn_bknown)
+ set_bknown(obj, 1);
verbalize("You %s %s %s, you pay for %s!",
alteration_verbs[alter_type], those, simpleonames(obj),
them);
bill_dummy_object(obj);
break;
case OBJ_FLOOR:
- if (set_bknown)
- obj->bknown = 1;
+ if (learn_bknown)
+ obj->bknown = 1; /* ok to bypass set_bknown() here */
if (costly_spot(u.ux, u.uy) && objroom == *u.ushops) {
verbalize("You %s %s, you pay for %s!",
alteration_verbs[alter_type], those, them);
return (!!otmp->blessed - !!otmp->cursed);
}
+/* set the object's bless/curse-state known flag */
+void
+set_bknown(obj, onoff)
+struct obj *obj;
+unsigned onoff; /* 1 or 0 */
+{
+ if (obj->bknown != onoff) {
+ obj->bknown = onoff;
+ if (obj->where == OBJ_INVENT && moves > 1L)
+ update_inventory();
+ }
+}
+
/*
* Calculate the weight of the given object. This will recursively follow
* and calculate the weight of any containers.
-/* NetHack 3.6 objnam.c $NHDT-Date: 1558485650 2019/05/22 00:40:50 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.241 $ */
+/* NetHack 3.6 objnam.c $NHDT-Date: 1559670607 2019/06/04 17:50:07 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.242 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
if (!nn && ocl->oc_uses_known && ocl->oc_unique)
obj->known = 0;
if (!Blind && !distantname)
- obj->dknown = TRUE;
+ obj->dknown = 1;
if (Role_if(PM_PRIEST))
- obj->bknown = TRUE;
+ obj->bknown = 1; /* actively avoid set_bknown();
+ * we mustn't call update_inventory() now because
+ * it would call xname() (via doname()) recursively
+ * and could end up clobbering all the obufs... */
if (iflags.override_ID) {
known = dknown = bknown = TRUE;
-/* NetHack 3.6 pickup.c $NHDT-Date: 1559130050 2019/05/29 11:40:50 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.226 $ */
+/* NetHack 3.6 pickup.c $NHDT-Date: 1559670608 2019/06/04 17:50:08 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.227 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
? TRUE : FALSE)
: TRUE; /* catchall: no filters specified, so accept */
- if (Role_if(PM_PRIEST))
- obj->bknown = TRUE;
+ if (Role_if(PM_PRIEST) && !obj->bknown)
+ set_bknown(obj, 1);
/*
* There are three types of filters possible and the first and
Icebox ? "refrigerate" : "stash", something);
return 0;
} else if ((obj->otyp == LOADSTONE) && obj->cursed) {
- obj->bknown = 1;
+ set_bknown(obj, 1);
pline_The("stone%s won't leave your person.", plur(obj->quan));
return 0;
} else if (obj->otyp == AMULET_OF_YENDOR
-/* NetHack 3.6 pray.c $NHDT-Date: 1549074257 2019/02/02 02:24:17 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.110 $ */
+/* NetHack 3.6 pray.c $NHDT-Date: 1559670608 2019/06/04 17:50:08 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.112 $ */
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
what ? what : (const char *) Yobjnam2(otmp, "softly glow"),
hcolor(NH_AMBER));
iflags.last_msg = PLNMSG_OBJ_GLOWS;
- otmp->bknown = !Hallucination;
+ otmp->bknown = !Hallucination; /* ok to skip set_bknown() */
}
uncurse(otmp);
update_inventory();
otmp = which_armor(u.usteed, W_SADDLE);
if (!Blind) {
pline("%s %s.", Yobjnam2(otmp, "softly glow"), hcolor(NH_AMBER));
- otmp->bknown = TRUE;
+ set_bknown(otmp, 1);
}
uncurse(otmp);
break;
make_splbk:
obj = mksobj(class_gift, TRUE, FALSE);
bless(obj);
- obj->bknown = TRUE;
+ obj->bknown = 1; /* ok to skip set_bknown() */
at_your_feet("A spellbook");
dropy(obj);
u.ugifts++;
bless(obj);
obj->oeroded = obj->oeroded2 = 0;
obj->oerodeproof = TRUE;
- obj->bknown = obj->rknown = TRUE;
+ obj->bknown = obj->rknown = 1; /* ok to skip set_bknown() */
if (obj->spe < 1)
obj->spe = 1;
/* acquire skill in this weapon */
You_feel("the power of %s over %s.", u_gname(),
yname(uwep));
uncurse(uwep);
- uwep->bknown = TRUE;
+ uwep->bknown = 1; /* ok to bypass set_bknown() */
*repair_buf = '\0';
} else if (!uwep->blessed) {
if (!Blind) {
You_feel("the blessing of %s over %s.", u_gname(),
yname(uwep));
bless(uwep);
- uwep->bknown = TRUE;
+ uwep->bknown = 1; /* ok to bypass set_bknown() */
*repair_buf = '\0';
}
pline("%s %s.", Yobjnam2(otmp, "softly glow"),
hcolor(NH_AMBER));
iflags.last_msg = PLNMSG_OBJ_GLOWS;
- otmp->bknown = TRUE;
+ otmp->bknown = 1; /* ok to bypass set_bknown() */
++any;
}
uncurse(otmp);
&& (bless_water ? !otmp->blessed : !otmp->cursed)) {
otmp->blessed = bless_water;
otmp->cursed = !bless_water;
- otmp->bknown = bc_known;
+ otmp->bknown = bc_known; /* ok to bypass set_bknown() */
changed += otmp->quan;
} else if (otmp->oclass == POTION_CLASS)
other = TRUE;
-/* NetHack 3.6 sit.c $NHDT-Date: 1544442714 2018/12/10 11:51:54 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.59 $ */
+/* NetHack 3.6 sit.c $NHDT-Date: 1559670609 2019/06/04 17:50:09 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.61 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
if (!Blind) {
pline("%s %s.", Yobjnam2(otmp, "glow"),
hcolor(otmp->cursed ? NH_BLACK : (const char *) "brown"));
- otmp->bknown = TRUE;
+ otmp->bknown = 1; /* ok to bypass set_bknown() here */
}
}
}
-/* NetHack 3.6 steed.c $NHDT-Date: 1559422254 2019/06/01 20:50:54 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.64 $ */
+/* NetHack 3.6 steed.c $NHDT-Date: 1559670610 2019/06/04 17:50:10 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.66 $ */
/* Copyright (c) Kevin Hugo, 1998-1999. */
/* NetHack may be freely redistributed. See license for details. */
if (otmp && otmp->cursed) {
You("can't. The saddle %s cursed.",
otmp->bknown ? "is" : "seems to be");
- otmp->bknown = TRUE;
+ otmp->bknown = 1; /* ok to skip set_bknown() here */
return;
}
if (!have_spot) {
-/* NetHack 3.6 wield.c $NHDT-Date: 1543492132 2018/11/29 11:48:52 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.58 $ */
+/* NetHack 3.6 wield.c $NHDT-Date: 1559670611 2019/06/04 17:50:11 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.59 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2009. */
/* NetHack may be freely redistributed. See license for details. */
(wep->quan == 1L) ? "itself" : "themselves", /* a3 */
bimanual(wep) ? (const char *) makeplural(body_part(HAND))
: body_part(HAND));
- wep->bknown = TRUE;
+ set_bknown(wep, 1);
} else {
/* The message must be printed before setuwep (since
* you might die and be revived from changing weapons),
; /* must be life-saved to reach here; return FALSE */
} else if (Glib || uswapwep->cursed) {
if (!Glib)
- uswapwep->bknown = TRUE;
+ set_bknown(uswapwep, 1);
drop_uswapwep();
} else
return TRUE;
if (!Blind) {
Sprintf(buf, "%s with %s aura.",
Yobjnam2(uwep, "glow"), an(hcolor(NH_AMBER)));
- uwep->bknown = !Hallucination;
+ uwep->bknown = !Hallucination; /* ok to bypass set_bknown() */
} else {
/* cursed tin opener is wielded in right hand */
Sprintf(buf, "Your right %s tingles.", body_part(HAND));
register struct obj *obj;
{
if (obj && obj == uwep && will_weld(obj)) {
- obj->bknown = TRUE;
+ set_bknown(obj, 1);
return 1;
}
return 0;