ensure mksobj() always attaches timer
Previously, if mksobj() was called with the 1st argument having a value of CORPSE, and a second argument (init) set to FALSE, the corpse would never get a timer attached.
This commit is contained in:
10
src/mkobj.c
10
src/mkobj.c
@@ -416,7 +416,7 @@ boolean artif;
|
||||
this level; let's create an adventurer's corpse instead, then */
|
||||
otmp->corpsenm = PM_HUMAN;
|
||||
}
|
||||
start_corpse_timeout(otmp);
|
||||
/* timer set below */
|
||||
break;
|
||||
case EGG:
|
||||
otmp->corpsenm = NON_PM; /* generic egg */
|
||||
@@ -617,6 +617,14 @@ boolean artif;
|
||||
objects[otmp->otyp].oc_class);
|
||||
return (struct obj *)0;
|
||||
}
|
||||
|
||||
/* Some things must get done (timers) even if init = 0 */
|
||||
switch (otmp->otyp) {
|
||||
case CORPSE:
|
||||
start_corpse_timeout(otmp);
|
||||
break;
|
||||
}
|
||||
|
||||
/* unique objects may have an associated artifact entry */
|
||||
if (objects[otyp].oc_unique && !otmp->oartifact)
|
||||
otmp = mk_artifact(otmp, (aligntyp)A_NONE);
|
||||
|
||||
Reference in New Issue
Block a user