additonal oextra care
Be deliberately careful with copies taken of oextra pointers and clear the pointer if it truly is a redundant copy that will become invalid if/when the original holder is deallocated.
This commit is contained in:
@@ -403,6 +403,10 @@ struct obj *instr;
|
||||
struct obj itmp;
|
||||
|
||||
itmp = *instr;
|
||||
itmp.oextra = (struct oextra *)0; /* ok on this copy as instr maintains
|
||||
the ptr to free at some point if
|
||||
there is one */
|
||||
|
||||
/* if won't yield special effect, make sound of mundane counterpart */
|
||||
if (!do_spec || instr->spe <= 0)
|
||||
while (objects[itmp.otyp].oc_magic) itmp.otyp -= 1;
|
||||
|
||||
Reference in New Issue
Block a user