-$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.35 $ $NHDT-Date: 1559670600 2019/06/04 17:50:00 $
+$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.36 $ $NHDT-Date: 1559675614 2019/06/04 19:13:34 $
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,
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)
+similar perm_invent issue when lock state known and/or contents known become
+ set for carried container
Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository
-/* NetHack 3.6 end.c $NHDT-Date: 1559664950 2019/06/04 16:15:50 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.175 $ */
+/* NetHack 3.6 end.c $NHDT-Date: 1559675615 2019/06/04 19:13:35 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.176 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
for (box = list; box; box = box->nobj) {
if (Is_container(box) || box->otyp == STATUE) {
- box->cknown = 1; /* we're looking at the contents now */
- if (identified)
- box->lknown = 1;
+ if (!box->cknown || (identified && !box->lknown)) {
+ box->cknown = 1; /* we're looking at the contents now */
+ if (identified)
+ box->lknown = 1;
+ update_inventory();
+ }
if (box->otyp == BAG_OF_TRICKS) {
continue; /* wrong type of container */
} else if (box->cobj) {
-/* NetHack 3.6 pickup.c $NHDT-Date: 1559670608 2019/06/04 17:50:08 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.227 $ */
+/* NetHack 3.6 pickup.c $NHDT-Date: 1559675617 2019/06/04 19:13:37 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.228 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
cobj->lknown = 1;
return 0;
}
- cobj->lknown = 1;
+ cobj->lknown = 1; /* floor container, so no need for update_inventory() */
if (cobj->otyp == BAG_OF_TRICKS) {
int tmp;
if (!u_handsy())
return 0;
+ if (!obj->lknown) { /* do this in advance */
+ obj->lknown = 1;
+ if (held)
+ update_inventory();
+ }
if (obj->olocked) {
pline("%s locked.", Tobjnam(obj, "are"));
if (held)
You("must put it down to unlock.");
- obj->lknown = 1;
return 0;
} else if (obj->otrapped) {
if (held)
You("open %s...", the(xname(obj)));
- obj->lknown = 1;
(void) chest_trap(obj, HAND, FALSE);
/* even if the trap fails, you've used up this turn */
if (multi >= 0) { /* in case we didn't become paralyzed */
abort_looting = TRUE;
return 1;
}
- obj->lknown = 1;
current_container = obj; /* for use by in/out_container */
/*
/* caveat: this assumes that cknown, lknown, olocked, and otrapped
fields haven't been overloaded to mean something special for the
non-standard "container" horn of plenty */
- box->lknown = 1;
+ if (!box->lknown) {
+ box->lknown = 1;
+ if (carried(box))
+ update_inventory(); /* jumping the gun slightly; hope that's ok */
+ }
if (box->olocked) {
pline("It's locked.");
} else if (box->otrapped) {
if (held)
(void) encumber_msg();
}
+ if (carried(box)) /* box is now empty with cknown set */
+ update_inventory();
}
/*pickup.c*/
-/* NetHack 3.6 zap.c $NHDT-Date: 1551395521 2019/02/28 23:12:01 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.307 $ */
+/* NetHack 3.6 zap.c $NHDT-Date: 1559675618 2019/06/04 19:13:38 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.309 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
if (obj->dknown)
makeknown(obj->otyp);
}
+ update_inventory();
}
}
(void) boxlock(obj, otmp);
if (obj_shudders(obj)) {
- boolean cover =
- ((obj == level.objects[u.ux][u.uy]) && u.uundetected
- && hides_under(youmonst.data));
+ boolean cover = ((obj == level.objects[u.ux][u.uy])
+ && u.uundetected
+ && hides_under(youmonst.data));
if (cansee(obj->ox, obj->oy))
learn_it = TRUE;
obj->cknown = 0;
} else {
struct obj *o;
+
/* view contents (not recursively) */
for (o = obj->cobj; o; o = o->nobj)
o->dknown = 1; /* "seen", even if blind */
learn_it = TRUE;
unpunish();
}
- if (u.utrap) { /* escape web or bear trap */
- (void) openholdingtrap(&youmonst, &learn_it);
- } else {
+ /* invent is hit iff hero doesn't escape from a trap */
+ if (!u.utrap || !openholdingtrap(&youmonst, &learn_it)) {
struct obj *otmp;
+ boolean boxing = FALSE;
+
/* unlock carried boxes */
for (otmp = invent; otmp; otmp = otmp->nobj)
- if (Is_box(otmp))
+ if (Is_box(otmp)) {
(void) boxlock(otmp, obj);
+ boxing = TRUE;
+ }
+ if (boxing)
+ update_inventory(); /* in case any box->lknown has changed */
+
/* trigger previously escaped trapdoor */
(void) openfallingtrap(&youmonst, TRUE, &learn_it);
}
break;
case WAN_LOCKING:
case SPE_WIZARD_LOCK:
- if (!u.utrap) {
- (void) closeholdingtrap(&youmonst, &learn_it);
+ /* similar logic to opening; invent is hit iff no trap triggered */
+ if (u.utrap || !closeholdingtrap(&youmonst, &learn_it)) {
+ struct obj *otmp;
+ boolean boxing = FALSE;
+
+ /* lock carried boxes */
+ for (otmp = invent; otmp; otmp = otmp->nobj)
+ if (Is_box(otmp)) {
+ (void) boxlock(otmp, obj);
+ boxing = TRUE;
+ }
+ if (boxing)
+ update_inventory(); /* in case any box->lknown has changed */
}
break;
case WAN_DIGGING:
otmp->cknown = 1;
}
}
+ update_inventory();
learn_it = TRUE;
ustatusline();
break;