trunk only: preserving context (src files)
Pat Rankin wrote: > collect them all into some new struct and > save that separately rather than jamming more non-option stuff > into struct flags. This patch: - collects all context/tracking related fields from flags into a new structure called "context." It also adds the following to the new structure: - stethoscope turn support - victual support - tin support
This commit is contained in:
14
src/mkobj.c
14
src/mkobj.c
@@ -230,8 +230,8 @@ long num;
|
||||
panic("splitobj"); /* can't split containers */
|
||||
otmp = newobj(obj->oxlth + obj->onamelth);
|
||||
*otmp = *obj; /* copies whole structure */
|
||||
otmp->o_id = flags.ident++;
|
||||
if (!otmp->o_id) otmp->o_id = flags.ident++; /* ident overflowed */
|
||||
otmp->o_id = context.ident++;
|
||||
if (!otmp->o_id) otmp->o_id = context.ident++; /* ident overflowed */
|
||||
otmp->timed = 0; /* not timed, yet */
|
||||
otmp->lamplit = 0; /* ditto */
|
||||
otmp->owornmask = 0L; /* new object isn't worn */
|
||||
@@ -332,8 +332,8 @@ register struct obj *otmp;
|
||||
dummy = newobj(otmp->oxlth + otmp->onamelth);
|
||||
*dummy = *otmp;
|
||||
dummy->where = OBJ_FREE;
|
||||
dummy->o_id = flags.ident++;
|
||||
if (!dummy->o_id) dummy->o_id = flags.ident++; /* ident overflowed */
|
||||
dummy->o_id = context.ident++;
|
||||
if (!dummy->o_id) dummy->o_id = context.ident++; /* ident overflowed */
|
||||
dummy->timed = 0;
|
||||
if (otmp->oxlth)
|
||||
(void)memcpy((genericptr_t)dummy->oextra,
|
||||
@@ -365,8 +365,8 @@ boolean artif;
|
||||
otmp = newobj(0);
|
||||
*otmp = zeroobj;
|
||||
otmp->age = monstermoves;
|
||||
otmp->o_id = flags.ident++;
|
||||
if (!otmp->o_id) otmp->o_id = flags.ident++; /* ident overflowed */
|
||||
otmp->o_id = context.ident++;
|
||||
if (!otmp->o_id) otmp->o_id = context.ident++; /* ident overflowed */
|
||||
otmp->quan = 1L;
|
||||
otmp->oclass = let;
|
||||
otmp->otyp = otyp;
|
||||
@@ -517,7 +517,7 @@ boolean artif;
|
||||
}
|
||||
break;
|
||||
case AMULET_CLASS:
|
||||
if (otmp->otyp == AMULET_OF_YENDOR) flags.made_amulet = TRUE;
|
||||
if (otmp->otyp == AMULET_OF_YENDOR) context.made_amulet = TRUE;
|
||||
if(rn2(10) && (otmp->otyp == AMULET_OF_STRANGULATION ||
|
||||
otmp->otyp == AMULET_OF_CHANGE ||
|
||||
otmp->otyp == AMULET_OF_RESTFUL_SLEEP)) {
|
||||
|
||||
Reference in New Issue
Block a user