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

Function food_substitution

src/eat.c:408–419  ·  view source on GitHub ↗

renaming an object used to result in it having a different address, so the sequence start eating/opening, get interrupted, name the food, resume eating/opening would restart from scratch */

Source from the content-addressed store, hash-verified

406 so the sequence start eating/opening, get interrupted, name the food,
407 resume eating/opening would restart from scratch */
408void
409food_substitution(struct obj *old_obj, struct obj *new_obj)
410{
411 if (old_obj == svc.context.victual.piece) {
412 svc.context.victual.piece = new_obj;
413 svc.context.victual.o_id = new_obj->o_id;
414 }
415 if (old_obj == svc.context.tin.tin) {
416 svc.context.tin.tin = new_obj;
417 svc.context.tin.o_id = new_obj->o_id;
418 }
419}
420
421staticfn void
422do_reset_eat(void)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected