]> granicus.if.org Git - nethack/commitdiff
Fix making fake leash object with leashmon set
authorPasi Kallinen <paxed@alt.org>
Fri, 1 Feb 2019 16:19:00 +0000 (18:19 +0200)
committerPasi Kallinen <paxed@alt.org>
Fri, 1 Feb 2019 16:19:04 +0000 (18:19 +0200)
When farlooking at a leash glyph on a map, the fake object should never
have leashmon set. This happened when a mimic was on the same spot
and was mimicing a corpse or statue, due to leashmon and corpsenm
using the same field.

src/pager.c

index e0c727479dbfce1106d9206216d8872a7804c303..775eabbc98deb1c5e7cd8412356f259f586f47a6 100644 (file)
@@ -187,14 +187,14 @@ struct obj **obj_p;
             otmp->quan = 2L; /* to force pluralization */
         else if (otmp->otyp == SLIME_MOLD)
             otmp->spe = context.current_fruit; /* give it a type */
-        else if (otmp->otyp == LEASH)
-            otmp->leashmon = 0;
         if (mtmp && has_mcorpsenm(mtmp)) /* mimic as corpse/statue */
             otmp->corpsenm = MCORPSENM(mtmp);
         else if (otmp->otyp == CORPSE && glyph_is_body(glyph))
             otmp->corpsenm = glyph - GLYPH_BODY_OFF;
         else if (otmp->otyp == STATUE && glyph_is_statue(glyph))
             otmp->corpsenm = glyph - GLYPH_STATUE_OFF;
+        if (otmp->otyp == LEASH)
+            otmp->leashmon = 0;
     }
     /* if located at adjacent spot, mark it as having been seen up close
        (corpse type will be known even if dknown is 0, so we don't need a