object deletion bookkeeping

Remove some obfree() vs dealloc_obj() confusion.
This commit is contained in:
nethack.rankin
2007-05-11 00:56:26 +00:00
parent 174182f0e4
commit 46a8bf78a3
2 changed files with 3 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ STATIC_DCL void FDECL(check_contained, (struct obj *,const char *));
#endif
extern struct obj *thrownobj; /* defined in dothrow.c */
extern struct obj *kickobj; /* dokick.c */
/*#define DEBUG_EFFECTS*/ /* show some messages for debugging */
@@ -1799,7 +1800,8 @@ dealloc_obj(obj)
if (obj_sheds_light(obj))
del_light_source(LS_OBJECT, obj_to_any(obj));
if (obj == thrownobj) thrownobj = (struct obj*)0;
if (obj == thrownobj) thrownobj = 0;
if (obj == kickobj) kickobj = 0;
if (obj->oextra) dealloc_oextra(obj->oextra);
free((genericptr_t) obj);

View File

@@ -857,8 +857,6 @@ register struct obj *obj, *merge;
can't call remove_worn_item() to get <X>_off() side-effects */
setnotworn(obj);
}
if (obj == thrownobj) thrownobj = 0;
if (obj == kickobj) kickobj = 0;
dealloc_obj(obj);
}