Skip to content

Commit

Permalink
more #H267 - cursed figurine auto-activation
Browse files Browse the repository at this point in the history
     Figurine activation timer had the same problem as burning objects:
it didn't clear up worn object pointers when destroying the object.
  • Loading branch information
nethack.rankin committed Mar 16, 2007
1 parent f480c57 commit 4e38da7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/fixes34.4
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ make score file processing more bullet proof to avoid potential security issue
towel equipped in weapon, alternate weapon, or quiver slot can be applied
lit candle or potion of oil which burned out while equipped would leave stale
weapon/alternate-weapon/quiver pointer that could cause panic or crash
wielded/worn figurine which auto-transformed had same stale pointer bug


Platform- and/or Interface-Specific Fixes
Expand Down
8 changes: 6 additions & 2 deletions src/apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -1852,8 +1852,12 @@ long timeout;
}
}
/* free figurine now */
obj_extract_self(figurine);
obfree(figurine, (struct obj *)0);
if (carried(figurine)) {
useup(figurine);
} else {
obj_extract_self(figurine);
obfree(figurine, (struct obj *)0);
}
if (redraw) newsym(cc.x, cc.y);
}

Expand Down

0 comments on commit 4e38da7

Please sign in to comment.