Skip to content

Commit 2729fb4

Browse files
committed
Fix: wished-for items with unspecified erosion shouldn't be eroded
Another bug induced by allowing items to generate eroded. The wish parser assumed that calling mksobj with init=TRUE would never produce erosion, so it didn't previously need to clear eroded flags on the item. Intended behavior is the same: the only erosion that should happen on a wished item is if the wisher explicitly asked for it.
1 parent 2a81855 commit 2729fb4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/objnam.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4706,6 +4706,9 @@ readobjnam(char* bp, struct obj* no_wish)
47064706

47074707
/* set eroded and erodeproof */
47084708
if (erosion_matters(d.otmp)) {
4709+
/* no wished-for item should be eroded if the wisher didn't specify it
4710+
* to be */
4711+
d.otmp->oeroded = d.otmp->oeroded2 = 0;
47094712
if (d.eroded && (is_flammable(d.otmp) || is_rustprone(d.otmp)))
47104713
d.otmp->oeroded = d.eroded;
47114714
if (d.eroded2 && (is_corrodeable(d.otmp) || is_rottable(d.otmp)))

0 commit comments

Comments
 (0)