interrupt current activity during certain stages of petrification or vomiting
warning about bad food didn't recognize tin of Medusa meat
eating tainted Medusa corpse caused food poisioning instead of petrification
+avoid potential stale pointer use after magic bag explosion
Platform- and/or Interface-Specific Fixes
-/* SCCS Id: @(#)apply.c 3.5 2004/12/21 */
+/* SCCS Id: @(#)apply.c 3.5 2005/01/05 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
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
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;
break;
case BAG_OF_TRICKS:
bagotricks(obj);
-/* SCCS Id: @(#)pickup.c 3.5 2004/01/03 */
+/* SCCS Id: @(#)pickup.c 3.5 2005/02/05 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
/* if you can figure this out, give yourself a hearty pat on the back... */
#define GOLD_CAPACITY(w,n) (((w) * -100L) - ((n) + 50L) - 1L)
+/* A variable set in use_container(), to be used by the callback routines */
+/* in_container() and out_container() from askchain() and use_container(). */
+/* Also used by doapply(apply.c). */
+struct obj *current_container;
+#define Icebox (current_container->otyp == ICE_BOX)
+
static const char moderateloadmsg[] = "You have a little trouble lifting";
static const char nearloadmsg[] = "You have much trouble lifting";
static const char overloadmsg[] = "You have extreme difficulty lifting";
return FALSE;
}
-/* A variable set in use_container(), to be used by the callback routines */
-/* in_container(), and out_container() from askchain() and use_container(). */
-static NEARDATA struct obj *current_container;
-#define Icebox (current_container->otyp == ICE_BOX)
-
/* Returns: -1 to stop, 1 item was inserted, 0 item was not inserted. */
STATIC_PTR int
in_container(obj)
if (!floor_container)
useup(current_container);
else if (obj_here(current_container, u.ux, u.uy))
- useupf(current_container, obj->quan);
+ useupf(current_container, current_container->quan);
else
panic("in_container: bag not found.");