spellbook of blank paper named Making Money

Reported directly to devteam, polymorphing a spellbook could produce
a blank spellbook with a Discworld novel's title attached.
This commit is contained in:
PatR
2024-02-27 11:27:02 -08:00
parent 334535e7b0
commit 1532a052c0
2 changed files with 9 additions and 3 deletions

View File

@@ -1789,9 +1789,12 @@ poly_obj(struct obj *obj, int id)
case SPBOOK_CLASS:
while (otmp->otyp == SPE_POLYMORPH)
otmp->otyp = rnd_class(SPE_DIG, SPE_BLANK_PAPER);
/* reduce spellbook abuse; non-blank books degrade */
if (otmp->otyp != SPE_BLANK_PAPER) {
otmp->otyp = rnd_class(gb.bases[SPBOOK_CLASS], SPE_BLANK_PAPER);
/* reduce spellbook abuse; non-blank books degrade;
3.7: novels don't use spestudied so shouldn't degrade to blank
(but don't force spestudied to zero for them since a non-zero
value could get passed along to a future polymorph) */
if (otmp->otyp != SPE_BLANK_PAPER && otmp->otyp != SPE_NOVEL) {
otmp->spestudied = obj->spestudied + 1;
if (otmp->spestudied > MAX_SPELL_STUDY) {
otmp->otyp = SPE_BLANK_PAPER;