MCPcopy Create free account
hub / github.com/NetHack/NetHack / done_eating

Function done_eating

src/eat.c:543–573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

541}
542
543staticfn void
544done_eating(boolean message)
545{
546 struct obj *piece = svc.context.victual.piece;
547
548 piece->in_use = TRUE;
549 go.occupation = 0; /* do this early, so newuhs() knows we're done */
550 newuhs(FALSE);
551 if (gn.nomovemsg) {
552 if (message)
553 pline1(gn.nomovemsg);
554 gn.nomovemsg = 0;
555 } else if (message) {
556 You("finish %s %s.",
557 (gy.youmonst.data == &mons[PM_FIRE_ELEMENTAL]) ? "consuming"
558 : "eating",
559 food_xname(piece, TRUE));
560 }
561
562 if (piece->otyp == CORPSE || piece->globby)
563 cpostfx(piece->corpsenm);
564 else
565 fpostfx(piece);
566
567 if (carried(piece))
568 useup(piece);
569 else
570 useupf(piece, 1L);
571
572 svc.context.victual = zero_victual; /* victual.piece = 0, .o_id = 0 */
573}
574
575void
576eating_conducts(struct permonst *pd)

Callers 2

eatfoodFunction · 0.85
start_eatingFunction · 0.85

Calls 7

newuhsFunction · 0.85
YouFunction · 0.85
food_xnameFunction · 0.85
cpostfxFunction · 0.85
fpostfxFunction · 0.85
useupFunction · 0.85
useupfFunction · 0.85

Tested by

no test coverage detected