]> granicus.if.org Git - nethack/commitdiff
ensure mksobj() always attaches timer
authornethack.allison <nethack.allison>
Fri, 18 Jul 2003 12:06:08 +0000 (12:06 +0000)
committernethack.allison <nethack.allison>
Fri, 18 Jul 2003 12:06:08 +0000 (12:06 +0000)
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.

doc/fixes34.2
src/mkobj.c

index 3dc3aa564daa96ef9e61fe865370172795fb5de5..6945d9ca0a72c9e3813b14aa1a95a3e78eedb059 100644 (file)
@@ -104,6 +104,7 @@ finding a statue trap you are about to dig should stop your occupation
 try to keep saddle at the same location as the steed corpse
 never display I symbol on the mounted hero/steed location
 pit digging is no longer stopped by a sleeping monster next to you
+ensure mksobj() always attaches timer to corpse, even if called with init FALSE
 
 
 Platform- and/or Interface-Specific Fixes
index 15b9380ba10c7b3744c37a04ac16cdbd74318291..5631ede68358dd5d5be7d7750243508b91dbb284 100644 (file)
@@ -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);