Skip to content

Commit

Permalink
Fix: object property from wearing a t-shirt persisted if the t-shirt …
Browse files Browse the repository at this point in the history
…was destoryed or fell off when polymorphing.

Thanks terrapin for the code fix.
  • Loading branch information
k21971 committed Mar 9, 2024
1 parent 04a05fd commit ef579bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions doc/evilhack-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3354,4 +3354,6 @@ The following changes to date are:
- Ammo created by the Ranger quest artifact is fully identified
- Hobbit rangers start with a crossbow instead of a bow, quest artifact is
the Crossbow of Carl
- Fix: object property from wearing a t-shirt persisted if the t-shirt was
destoryed or fell off when polymorphing

7 changes: 4 additions & 3 deletions src/polyself.c
Original file line number Diff line number Diff line change
Expand Up @@ -1042,9 +1042,10 @@ break_armor()
}
}
}
if (uarmu) {
if ((otmp = uarmu)) {
Your("shirt rips to shreds!");
useup(uarmu);
(void) Shirt_off();
useup(otmp);
}
} else if (sliparm(&youmonst)) {
if (((otmp = uarm) != 0) && (racial_exception(&youmonst, otmp) < 1)) {
Expand All @@ -1071,7 +1072,7 @@ break_armor()
You("seep right through your shirt!");
else
You("become much too small for your shirt!");
setworn((struct obj *) 0, otmp->owornmask & W_ARMU);
(void) Shirt_off();
dropp(otmp);
}
/* catch what breakarm() and sliparm() doesn't handle */
Expand Down

0 comments on commit ef579bc

Please sign in to comment.