blanking novels

Simplify converting novels into blank spellbooks via water damage.
Since that can occur, update cancellation to do it too.
This commit is contained in:
PatR
2024-03-28 23:44:34 -07:00
parent b4cd1d6ee0
commit e4ffda7386
3 changed files with 25 additions and 14 deletions

View File

@@ -4613,16 +4613,8 @@ water_damage(
obj->spestudied = rn2(obj->spestudied);
obj->dknown = 0;
/* blanking a novel is more involved than blanking a spellbook */
if (otyp == SPE_NOVEL) { /* old type */
obj->novelidx = 0; /* overloads corpsenm, not used for splbooks */
free_oname(obj);
/* novels weigh less than spellbooks; apparently blanking them
magically makes them become heavier */
do {
obj->owt = weight(obj);
obj = (obj->where == OBJ_CONTAINED) ? obj->ocontainer : 0;
} while (obj);
}
if (otyp == SPE_NOVEL) /* old type */
blank_novel(obj);
if (in_invent)
update_inventory();
return ER_DAMAGED;