makeknown()

Noticed while investigating the report about sortloot interacting
with persistent inventory window when identifying all of invent and
possibly skipping some items.  [This doesn't fix that.]

End of game disclosure was using makeknown() on inventory.  It is a
jacket around discover_object() which passes the flag to exercise
Wisdom.  That's useless at end of game [now; conceivably wrong if
disclosure of characteristics exercise ever got added], so call
discover_object() directly to suppress exercise of Wisdom.

discover_object() was also calling update_inventory() for every item
being discovered.  That's not useful when looping through inventory
at end of game.
This commit is contained in:
PatR
2018-06-06 17:45:44 -07:00
committed by nhmall
parent 15995375dd
commit 7951557057
3 changed files with 10 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 o_init.c $NHDT-Date: 1450318588 2015/12/17 02:16:28 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.22 $ */
/* NetHack 3.6 o_init.c $NHDT-Date: 1528332336 2018/06/07 00:45:36 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.24 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -361,7 +361,8 @@ boolean credit_hero;
if (credit_hero)
exercise(A_WIS, TRUE);
}
if (moves > 1L)
/* moves==1L => initial inventory, gameover => final disclosure */
if (moves > 1L && !program_state.gameover)
update_inventory();
}
}