From 86b84568ea7dff0af185641d0fac33855e6d339f Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 4 Jun 2015 17:39:21 +0300 Subject: [PATCH] Monster detection shows pets with the correct glyph Make pets hilited when detected with uncursed potion of monster detection and hilite_pet is on. Noticed by Raisse. --- src/detect.c | 3 ++- src/worm.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/detect.c b/src/detect.c index ee25935f4..c149cac69 100644 --- a/src/detect.c +++ b/src/detect.c @@ -637,7 +637,8 @@ int mclass; /* monster class, 0 for all */ show_glyph(mtmp->mx, mtmp->my, detected_mon_to_glyph(mtmp)); else - show_glyph(mtmp->mx, mtmp->my, mon_to_glyph(mtmp)); + show_glyph(mtmp->mx, mtmp->my, + mtmp->mtame ? pet_to_glyph(mtmp) : mon_to_glyph(mtmp)); /* don't be stingy - display entire worm */ if (mtmp->data == &mons[PM_LONG_WORM]) detect_wsegs(mtmp, 0); diff --git a/src/worm.c b/src/worm.c index c4ad029fc..cb3dc4922 100644 --- a/src/worm.c +++ b/src/worm.c @@ -465,8 +465,10 @@ boolean use_detection_glyph; while (curr != wheads[worm->wormno]) { num = use_detection_glyph - ? detected_monnum_to_glyph(what_mon(PM_LONG_WORM_TAIL)) - : monnum_to_glyph(what_mon(PM_LONG_WORM_TAIL)); + ? detected_monnum_to_glyph(what_mon(PM_LONG_WORM_TAIL)) + : (worm->mtame + ? petnum_to_glyph(what_mon(PM_LONG_WORM_TAIL)) + : monnum_to_glyph(what_mon(PM_LONG_WORM_TAIL))); show_glyph(curr->wx, curr->wy, num); curr = curr->nseg; }