fix #H3039 - panic() when trying to drop destroyed items
From a bug report, dropping a lit (burning) potion of oil while levitating can produce an explosion which can destroy inventory. If in the process of dropping multiple items, the ones after the oil might be gone, resulting in use of stale pointers and possibly triggering an "extract_nobj: object lost" panic or even a crash. While testing my fix, I discovered that being killed by an exploding potion of oil could produce an "object_is_local" panic if bones are saved (and reproduced with unmodified 3.4.3).
This commit is contained in:
@@ -701,6 +701,7 @@ E long FDECL(rndexp, (BOOLEAN_P));
|
||||
E void FDECL(explode, (int,int,int,int,CHAR_P,int));
|
||||
E long FDECL(scatter, (int, int, int, unsigned int, struct obj *));
|
||||
E void FDECL(splatter_burning_oil, (int, int));
|
||||
E void FDECL(explode_oil, (struct obj *,int,int));
|
||||
|
||||
/* ### extralev.c ### */
|
||||
|
||||
@@ -2685,6 +2686,8 @@ E struct obj *FDECL(which_armor, (struct monst *,long));
|
||||
E void FDECL(mon_break_armor, (struct monst *,BOOLEAN_P));
|
||||
E void FDECL(bypass_obj, (struct obj *));
|
||||
E void NDECL(clear_bypasses);
|
||||
E void FDECL(bypass_objlist, (struct obj *,BOOLEAN_P));
|
||||
E struct obj *FDECL(nxt_unbypassed_obj, (struct obj *));
|
||||
E int FDECL(racial_exception, (struct monst *, struct obj *));
|
||||
|
||||
/* ### write.c ### */
|
||||
|
||||
Reference in New Issue
Block a user