Skip to content

Commit

Permalink
Work a call to touch_artifact into the eating non-food code, such tha…
Browse files Browse the repository at this point in the history
…t a player can't eat an artifact they can't touch. Fixes C343-244.
  • Loading branch information
sgrunt committed May 3, 2012
1 parent afc9e3d commit 7ed1784
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/eat.c
Original file line number Diff line number Diff line change
Expand Up @@ -2080,6 +2080,13 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
if (otmp->oclass != FOOD_CLASS) {
int material;
dont_start = FALSE;

if (!touch_artifact(otmp,&youmonst)) return 1;
if (!is_edible(otmp)) {
You("can no longer eat %s.", doname(otmp));
return 1;
}

victual.reqtime = 1;
victual.piece = otmp;
/* Don't split it, we don't need to if it's 1 move */
Expand Down

0 comments on commit 7ed1784

Please sign in to comment.