diff --git a/include/obj.h b/include/obj.h index 0fdd0d1ad..685c9165f 100644 --- a/include/obj.h +++ b/include/obj.h @@ -133,14 +133,19 @@ struct obj { #define spestudied usecount /* # of times a spellbook has been studied */ unsigned oeaten; /* nutrition left in food, if partly eaten */ long age; /* creation date */ - long owornmask; + long owornmask; /* bit mask indicating which equipment slot(s) an + * item is worn in [by hero or by monster; could + * indicate more than one bit: attached iron ball + * that's also wielded]; + * overloaded for the destination of migrating + * objects (which can't be worn at same time) */ unsigned lua_ref_cnt; /* # of lua script references for this object */ xchar omigr_from_dnum; /* where obj is migrating from */ xchar omigr_from_dlevel; /* where obj is migrating from */ struct oextra *oextra; /* pointer to oextra struct */ }; -#define newobj() (struct obj *) alloc(sizeof(struct obj)) +#define newobj() (struct obj *) alloc(sizeof (struct obj)) /*** ** oextra referencing and testing macros diff --git a/src/mkobj.c b/src/mkobj.c index 8345a055c..abe9f15be 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -1380,7 +1380,7 @@ shrink_glob( if (delta >= (long) obj->owt) { /* gone; no newsym() or message here--forthcoming map update for level arrival is all that's needed */ - obj->owt = 0; /* not required; accurately reflect's obj's state */ + obj->owt = 0; /* not required; accurately reflects obj's state */ shrinking_glob_gone(obj); } else { /* shrank but not gone; reduce remaining weight */ @@ -1524,8 +1524,8 @@ shrinking_glob_gone(struct obj *obj) useupall(obj); /* freeinv()+obfree() */ } else { if (obj->where == OBJ_MIGRATING) { - /* clear destination flag so that obfree()'s check for freeing - a worn object doesn't get a false hit */ + /* destination flag overloads owornmask; clear it so obfree()'s + check for freeing a worn object doesn't get a false hit */ obj->owornmask = 0L; } else if (obj->where == OBJ_MINVENT) { /* monsters don't wield globs so this isn't strictly needed */