cost of eating an unpaid tin

The cost of an unpaid tin should be calculated before eating, not after,
so the cost will be based on your pre-eating hunger, not post.
This commit is contained in:
cohrs
2002-01-21 03:25:50 +00:00
parent bf563bb204
commit 371bbc2fb8
2 changed files with 17 additions and 1 deletions

View File

@@ -398,6 +398,7 @@ pets should not try to go after food that they can't reach
monsters shouldn't use wands of digging in Sokoban
objects dropped in or travelling across java pools can take damage
monsters that enter lava can take damage
eating an unpaid tin should calculate cost before not after eating
Platform- and/or Interface-Specific Fixes

View File

@@ -1014,6 +1014,13 @@ opentin() /* called during each move whilst opening a tin */
tin.tin->dknown = tin.tin->known = TRUE;
cprefx(tin.tin->corpsenm); cpostfx(tin.tin->corpsenm);
if(((!carried(tin.tin) && costly_spot(tin.tin->ox, tin.tin->oy) &&
!tin.tin->no_charge)
|| tin.tin->unpaid)) {
verbalize("You open it, you bought it!");
bill_dummy_object(tin.tin);
}
/* check for vomiting added by GAN 01/16/87 */
if(tintxts[r].nut < 0) make_vomiting((long)rn1(15,10), FALSE);
else lesshungry(tintxts[r].nut);
@@ -1038,6 +1045,15 @@ opentin() /* called during each move whilst opening a tin */
You("discard the open tin.");
goto use_me;
}
tin.tin->dknown = tin.tin->known = TRUE;
if(((!carried(tin.tin) && costly_spot(tin.tin->ox, tin.tin->oy) &&
!tin.tin->no_charge)
|| tin.tin->unpaid)) {
verbalize("You open it, you bought it!");
bill_dummy_object(tin.tin);
}
if (!tin.tin->cursed)
pline("This makes you feel like %s!",
Hallucination ? "Swee'pea" : "Popeye");
@@ -1045,7 +1061,6 @@ opentin() /* called during each move whilst opening a tin */
gainstr(tin.tin, 0);
u.uconduct.food++;
}
tin.tin->dknown = tin.tin->known = TRUE;
use_me:
if (carried(tin.tin)) useup(tin.tin);
else useupf(tin.tin, 1L);