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
+1
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 monsters shouldn't use wands of digging in Sokoban
objects dropped in or travelling across java pools can take damage objects dropped in or travelling across java pools can take damage
monsters that enter lava 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 Platform- and/or Interface-Specific Fixes
+16 -1
View File
@@ -1014,6 +1014,13 @@ opentin() /* called during each move whilst opening a tin */
tin.tin->dknown = tin.tin->known = TRUE; tin.tin->dknown = tin.tin->known = TRUE;
cprefx(tin.tin->corpsenm); cpostfx(tin.tin->corpsenm); 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 */ /* check for vomiting added by GAN 01/16/87 */
if(tintxts[r].nut < 0) make_vomiting((long)rn1(15,10), FALSE); if(tintxts[r].nut < 0) make_vomiting((long)rn1(15,10), FALSE);
else lesshungry(tintxts[r].nut); else lesshungry(tintxts[r].nut);
@@ -1038,6 +1045,15 @@ opentin() /* called during each move whilst opening a tin */
You("discard the open tin."); You("discard the open tin.");
goto use_me; 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) if (!tin.tin->cursed)
pline("This makes you feel like %s!", pline("This makes you feel like %s!",
Hallucination ? "Swee'pea" : "Popeye"); Hallucination ? "Swee'pea" : "Popeye");
@@ -1045,7 +1061,6 @@ opentin() /* called during each move whilst opening a tin */
gainstr(tin.tin, 0); gainstr(tin.tin, 0);
u.uconduct.food++; u.uconduct.food++;
} }
tin.tin->dknown = tin.tin->known = TRUE;
use_me: use_me:
if (carried(tin.tin)) useup(tin.tin); if (carried(tin.tin)) useup(tin.tin);
else useupf(tin.tin, 1L); else useupf(tin.tin, 1L);