diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 30ffed891..7c70a7ab3 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -404,6 +404,7 @@ fix the 'A' command to have the 'D' command's fix for C331-1 (quirk for menustyle:Combination; if user included 'a' in "which object classes?" response, to operate on applicable all items, there would still be a followup menu asking to choose specific items) +eating 1 tin from stack of N (for N >= 2) on shop's floor forced hero to buy 2 Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository diff --git a/src/eat.c b/src/eat.c index 2c748ef06..4e011899d 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1,4 +1,4 @@ -/* 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. */ @@ -6,7 +6,7 @@ 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); @@ -1152,7 +1152,7 @@ violated_vegetarian() /* 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 */ { @@ -1166,6 +1166,7 @@ int alter_type; /* COST_xxx */ } costly_alteration(tin, alter_type); } + return tin; } int @@ -1293,7 +1294,7 @@ const char *mesg; 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; } @@ -1304,7 +1305,7 @@ const char *mesg; 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; } @@ -1333,7 +1334,7 @@ const char *mesg; 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; } @@ -1352,7 +1353,7 @@ const char *mesg; 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); @@ -1378,7 +1379,7 @@ const char *mesg; 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; } @@ -1386,14 +1387,13 @@ const char *mesg; * 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 */