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.
This commit is contained in:
Pasi Kallinen
2015-06-04 17:39:21 +03:00
parent 014547beb2
commit 86b84568ea
2 changed files with 6 additions and 3 deletions

View File

@@ -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);

View File

@@ -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;
}