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:
nethack.rankin
2005-02-08 04:57:54 +00:00
parent 01373731e5
commit 556b64e797
4 changed files with 58 additions and 34 deletions

View File

@@ -45,9 +45,6 @@ STATIC_DCL void FDECL(add_class, (char *, CHAR_P));
void FDECL( amii_speaker, ( struct obj *, char *, int ) );
#endif
/* managed by use_container(pickup.c) */
extern struct obj *current_container;
static const char no_elbow_room[] = "don't have enough elbow-room to maneuver.";
#ifdef TOURIST
@@ -2969,10 +2966,7 @@ doapply()
case SACK:
case BAG_OF_HOLDING:
case OILSKIN_SACK:
res = use_container(obj, 1);
/* magic bag might end up being destroyed;
if so, current_container will be null */
obj = current_container;
res = use_container(&obj, 1);
break;
case BAG_OF_TRICKS:
bagotricks(obj);