fix github issue #106 - polymorph panic

Fixes #106

If dipping a worn amulet into a potion of polymorph turns it into an
amulet of change, the game panics while trying to use up that amulet
when the new one hasn't replaced the old one in inventory yet.  Simply
reordering the relevant code isn't sufficient to fix things:  once it
is in inventory and can be successfully used up, later code would end
up deferencing a stale pointer because it was unaware of the deletion.
This commit is contained in:
PatR
2018-06-17 16:59:58 -07:00
parent 78fca9bef0
commit 4bce58f665
5 changed files with 52 additions and 27 deletions

View File

@@ -2830,6 +2830,7 @@ E int FDECL(wseg_at, (struct monst *, int, int));
E void FDECL(setworn, (struct obj *, long));
E void FDECL(setnotworn, (struct obj *));
E struct obj *FDECL(wearmask_to_obj, (long));
E long FDECL(wearslot, (struct obj *));
E void FDECL(mon_set_minvis, (struct monst *));
E void FDECL(mon_adjust_speed, (struct monst *, int, struct obj *));