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

Function book_substitution

src/spell.c:657–665  ·  view source on GitHub ↗

renaming an object usually results in it having a different address; so the sequence start reading, get interrupted, name the book, resume reading would read the "new" book from scratch */

Source from the content-addressed store, hash-verified

655 so the sequence start reading, get interrupted, name the book, resume
656 reading would read the "new" book from scratch */
657void
658book_substitution(struct obj *old_obj, struct obj *new_obj)
659{
660 if (old_obj == svc.context.spbook.book) {
661 svc.context.spbook.book = new_obj;
662 if (svc.context.spbook.book)
663 svc.context.spbook.o_id = svc.context.spbook.book->o_id;
664 }
665}
666
667/* called from moveloop() */
668void

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected