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

Function recalc_wt

src/eat.c:291–305  ·  view source on GitHub ↗

modify victual.piece->owt depending on time spent consuming it */

Source from the content-addressed store, hash-verified

289
290/* modify victual.piece->owt depending on time spent consuming it */
291staticfn void
292recalc_wt(void)
293{
294 struct obj *piece = svc.context.victual.piece;
295
296 if (!piece) {
297 impossible("recalc_wt without piece");
298 return;
299 }
300 debugpline1("Old weight = %d", piece->owt);
301 debugpline2("Used time = %d, Req'd time = %d",
302 svc.context.victual.usedtime, svc.context.victual.reqtime);
303 piece->owt = weight(piece);
304 debugpline1("New weight = %d", piece->owt);
305}
306
307/* called when eating interrupted by an event */
308void

Callers 2

do_reset_eatFunction · 0.85
biteFunction · 0.85

Calls 2

weightFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected