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

Function obj_nutrition

src/eat.c:324–332  ·  view source on GitHub ↗

base nutrition of a food-class object; this used to include a variation of the code that is now in adj_victual_nutrition() and was moved due to its affect on weight() */

Source from the content-addressed store, hash-verified

322 of the code that is now in adj_victual_nutrition() and was moved due to
323 its affect on weight() */
324unsigned
325obj_nutrition(struct obj *otmp)
326{
327 unsigned nut = (otmp->otyp == CORPSE) ? mons[otmp->corpsenm].cnutrit
328 : otmp->globby ? otmp->owt
329 : (unsigned) objects[otmp->otyp].oc_nutrition;
330
331 return nut;
332}
333
334/* nutrition increment for next byte; this used to be factored into
335 victual.piece->oeaten but that produced weight change if hero

Callers 5

readobjnamFunction · 0.85
touchfoodFunction · 0.85
doeatFunction · 0.85
eaten_statFunction · 0.85
consume_oeatenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected