container status bits (trunk only)
Couple of post-3.4.3 things: using ':' to view the contents when looting or applying a container wasn't setting its cknown flag (contents known); probing a container wasn't setting lknown flag (lock state known).
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)end.c 3.5 2005/03/11 */
|
/* SCCS Id: @(#)end.c 3.5 2005/11/02 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -972,6 +972,8 @@ boolean identified, all_containers;
|
|||||||
|
|
||||||
for (box = list; box; box = box->nobj) {
|
for (box = list; box; box = box->nobj) {
|
||||||
if (Is_container(box) || box->otyp == STATUE) {
|
if (Is_container(box) || box->otyp == STATUE) {
|
||||||
|
box->cknown = 1; /* we're looking at the contents now */
|
||||||
|
if (identified) box->lknown = 1;
|
||||||
cat = deadcat = FALSE;
|
cat = deadcat = FALSE;
|
||||||
if (box->otyp == LARGE_BOX &&
|
if (box->otyp == LARGE_BOX &&
|
||||||
box->spe == 1 && !Schroedingers_cat) {
|
box->spe == 1 && !Schroedingers_cat) {
|
||||||
@@ -980,7 +982,6 @@ boolean identified, all_containers;
|
|||||||
if (cat) Schroedingers_cat = TRUE;
|
if (cat) Schroedingers_cat = TRUE;
|
||||||
else deadcat = TRUE;
|
else deadcat = TRUE;
|
||||||
box->spe = 0;
|
box->spe = 0;
|
||||||
box->cknown = box->lknown = 1;
|
|
||||||
}
|
}
|
||||||
if (box->otyp == BAG_OF_TRICKS) {
|
if (box->otyp == BAG_OF_TRICKS) {
|
||||||
continue; /* wrong type of container */
|
continue; /* wrong type of container */
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)pickup.c 3.5 2005/06/02 */
|
/* SCCS Id: @(#)pickup.c 3.5 2005/11/02 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -219,6 +219,10 @@ ask_again:
|
|||||||
else if (sym == 'a') *everything = TRUE;
|
else if (sym == 'a') *everything = TRUE;
|
||||||
else if (sym == ':') {
|
else if (sym == ':') {
|
||||||
simple_look(objs, here); /* dumb if objs==invent */
|
simple_look(objs, here); /* dumb if objs==invent */
|
||||||
|
/* if we just scanned the contents of a container
|
||||||
|
then mark it as having known contents */
|
||||||
|
if (objs->where == OBJ_CONTAINED)
|
||||||
|
objs->ocontainer->cknown = 1;
|
||||||
goto ask_again;
|
goto ask_again;
|
||||||
} else if (sym == 'i') {
|
} else if (sym == 'i') {
|
||||||
(void) display_inventory((char *)0, TRUE);
|
(void) display_inventory((char *)0, TRUE);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)zap.c 3.5 2005/09/20 */
|
/* SCCS Id: @(#)zap.c 3.5 2005/11/02 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -1527,6 +1527,7 @@ struct obj *obj, *otmp;
|
|||||||
/* target object has now been "seen (up close)" */
|
/* target object has now been "seen (up close)" */
|
||||||
obj->dknown = 1;
|
obj->dknown = 1;
|
||||||
if (Is_container(obj) || obj->otyp == STATUE) {
|
if (Is_container(obj) || obj->otyp == STATUE) {
|
||||||
|
obj->cknown = obj->lknown = 1;
|
||||||
if (!obj->cobj)
|
if (!obj->cobj)
|
||||||
pline("%s empty.", Tobjnam(obj, "are"));
|
pline("%s empty.", Tobjnam(obj, "are"));
|
||||||
else {
|
else {
|
||||||
@@ -1536,7 +1537,6 @@ struct obj *obj, *otmp;
|
|||||||
o->dknown = 1; /* "seen", even if blind */
|
o->dknown = 1; /* "seen", even if blind */
|
||||||
(void) display_cinventory(obj);
|
(void) display_cinventory(obj);
|
||||||
}
|
}
|
||||||
obj->cknown = 1;
|
|
||||||
res = 1;
|
res = 1;
|
||||||
}
|
}
|
||||||
if (res) makeknown(WAN_PROBING);
|
if (res) makeknown(WAN_PROBING);
|
||||||
|
|||||||
Reference in New Issue
Block a user