fix #K3922 - magic whistle vs hidden pet

When a hidden pet was relocated via magic whistle, a message was given
about "your <pet> appears" but it didn't show up on the map.

It was being marked as no longer undetected, but that was after rloc()
had moved it and redrawn its location.  use_magic_whistle() needed to
redraw its location again after clearing monst->mundetected.
This commit is contained in:
PatR
2023-05-27 08:47:26 -07:00
parent e6521448f0
commit b6a5be8d77
2 changed files with 9 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 apply.c $NHDT-Date: 1655631557 2022/06/19 09:39:17 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.381 $ */
/* NetHack 3.7 apply.c $NHDT-Date: 1685202442 2023/05/27 15:47:22 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.420 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -540,7 +540,10 @@ magic_whistled(struct obj *obj)
mnexto(mtmp, !already_discovered ? RLOC_MSG : RLOC_NONE);
if (mtmp->mx != omx || mtmp->my != omy) {
mtmp->mundetected = 0; /* reveal non-mimic hider iff it moved */
if (mtmp->mundetected) { /* reveal non-mimic hider that moved */
mtmp->mundetected = 0;
newsym(mtmp->mx, mtmp->my);
}
/*
* FIXME:
* All relocated monsters should change positions essentially