yet more exploding magic pointers
Revert mostly to <Someone>'s original approach for keeping track of whether a container being applied or looted had been destroyed by the operation. askchain() now knows not to attempt to re-merge an item that has been destroyed (a theorhetical action since no stackable items can trigger a magic bag explosion) like the earlier change to menu_loot(). Also have use_container() clean up after itself so that current_container never has an old pointer value left around.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)invent.c 3.5 2004/11/03 */
|
||||
/* SCCS Id: @(#)invent.c 3.5 2005/02/07 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -1422,7 +1422,11 @@ nextclass:
|
||||
case 'y':
|
||||
tmp = (*fn)(otmp);
|
||||
if(tmp < 0) {
|
||||
if (otmp != otmpo) {
|
||||
if (container_gone(fn)) {
|
||||
/* otmp caused magic bag to explode;
|
||||
both are now gone */
|
||||
otmp = 0; /* and return */
|
||||
} else if (otmp && otmp != otmpo) {
|
||||
/* split occurred, merge again */
|
||||
(void) merged(&otmpo, &otmp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user