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:
nethack.allison
2006-05-13 20:19:06 +00:00
parent 9151db8aaf
commit 1fcbfd85c9
6 changed files with 19 additions and 7 deletions

View File

@@ -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;