-/* NetHack 3.6 eat.c $NHDT-Date: 1470272344 2016/08/04 00:59:04 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.172 $ */
+/* NetHack 3.6 eat.c $NHDT-Date: 1498778062 2017/06/29 23:14:22 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.178 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
STATIC_PTR int NDECL(eatmdone);
STATIC_PTR int NDECL(eatfood);
-STATIC_PTR void FDECL(costly_tin, (int));
+STATIC_PTR struct obj *FDECL(costly_tin, (int));
STATIC_PTR int NDECL(opentin);
STATIC_PTR int NDECL(unfaint);
/* common code to check and possibly charge for 1 context.tin.tin,
* will split() context.tin.tin if necessary */
-STATIC_PTR void
+STATIC_PTR struct obj *
costly_tin(alter_type)
int alter_type; /* COST_xxx */
{
}
costly_alteration(tin, alter_type);
}
+ return tin;
}
int
r = tin_variety(tin, FALSE);
if (tin->otrapped || (tin->cursed && r != HOMEMADE_TIN && !rn2(8))) {
b_trapped("tin", 0);
- costly_tin(COST_DSTROY);
+ tin = costly_tin(COST_DSTROY);
goto use_up_tin;
}
if (mnum == NON_PM) {
pline("It turns out to be empty.");
tin->dknown = tin->known = 1;
- costly_tin(COST_OPEN);
+ tin = costly_tin(COST_OPEN);
goto use_up_tin;
}
You("discard the open tin.");
if (!Hallucination)
tin->dknown = tin->known = 1;
- costly_tin(COST_OPEN);
+ tin = costly_tin(COST_OPEN);
goto use_up_tin;
}
cpostfx(mnum);
/* charge for one at pre-eating cost */
- costly_tin(COST_OPEN);
+ tin = costly_tin(COST_OPEN);
if (tintxts[r].nut < 0) /* rotten */
make_vomiting((long) rn1(15, 10), FALSE);
if (yn("Eat it?") == 'n') {
if (flags.verbose)
You("discard the open tin.");
- costly_tin(COST_OPEN);
+ tin = costly_tin(COST_OPEN);
goto use_up_tin;
}
* Same order as with non-spinach above:
* conduct update, side-effects, shop handling, and nutrition.
*/
- u.uconduct
- .food++; /* don't need vegan/vegetarian checks for spinach */
+ u.uconduct.food++; /* don't need vegetarian checks for spinach */
if (!tin->cursed)
pline("This makes you feel like %s!",
Hallucination ? "Swee'pea" : "Popeye");
gainstr(tin, 0, FALSE);
- costly_tin(COST_OPEN);
+ tin = costly_tin(COST_OPEN);
lesshungry(tin->blessed
? 600 /* blessed */