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 @@
HDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1181 $ $NHDT-Date: 1684621591 2023/05/20 22:26:31 $
HDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1188 $ $NHDT-Date: 1685202441 2023/05/27 15:47:21 $
General Fixes and Modified Features
-----------------------------------
@@ -1595,6 +1595,9 @@ quest nemesis and a few other special monsters are suppressed from bones;
running the tutorial until completion and returning to normal play but left
the 'no followers' flag set; adjacent pets wouldn't tag along when
hero moved to other levels
when a magic whistle moved a hidden pet it brought that out of hiding and
gave a message about "your <pet> appears" but the map was updated
while it was still hidden so nothing seemed to appear
Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository

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