-HDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.908 $ $NHDT-Date: 1652091707 2022/05/09 10:21:47 $
+HDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.913 $ $NHDT-Date: 1652299940 2022/05/11 20:12:20 $
General Fixes and Modified Features
-----------------------------------
walk across the threshold from no-threat to threat
revised monster teleportation message handling caused magic whistle to be
changed to not operate on pets that were already adjacent; change back
+revised monster teleportation message handling could produce duplicate message
+ when shopkeeper who left shop got returned to it
curses: 'msg_window' option wasn't functional for curses unless the binary
also included tty support
-/* NetHack 3.7 extern.h $NHDT-Date: 1651886993 2022/05/07 01:29:53 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1112 $ */
+/* NetHack 3.7 extern.h $NHDT-Date: 1652299940 2022/05/11 20:12:20 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1114 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
extern boolean is_unpaid(struct obj *);
extern void delete_contents(struct obj *);
extern void obfree(struct obj *, struct obj *);
-extern void home_shk(struct monst *, boolean);
extern void make_happy_shk(struct monst *, boolean);
extern void make_happy_shoppers(boolean);
extern void hot_pursuit(struct monst *);
-/* NetHack 3.7 shk.c $NHDT-Date: 1629548922 2021/08/21 12:28:42 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.205 $ */
+/* NetHack 3.7 shk.c $NHDT-Date: 1652299941 2022/05/11 20:12:21 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.232 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
static struct obj *bp_to_obj(struct bill_x *);
static long get_pricing_units(struct obj *);
static boolean angry_shk_exists(void);
+static void home_shk(struct monst *, boolean);
static void rile_shk(struct monst *);
static void rouse_shk(struct monst *, boolean);
static boolean shk_impaired(struct monst *);
}
/* return shkp to home position */
-void
-home_shk(register struct monst* shkp, register boolean killkops)
+static void
+home_shk(struct monst *shkp, boolean killkops)
{
- register xchar x = ESHK(shkp)->shk.x, y = ESHK(shkp)->shk.y;
+ xchar x = ESHK(shkp)->shk.x, y = ESHK(shkp)->shk.y;
- (void) mnearto(shkp, x, y, TRUE, RLOC_MSG);
+ (void) mnearto(shkp, x, y, TRUE, RLOC_NOMSG);
g.level.flags.has_shop = 1;
if (killkops) {
kops_gone(TRUE);
Strcpy(shk_nam, shkname(shkp));
if (on_level(&eshkp->shoplevel, &u.uz)) {
home_shk(shkp, FALSE);
- /* didn't disappear if shk can still be seen */
- if (canseemon(shkp))
- vanished = FALSE;
+ if (canspotmon(shkp)) {
+ pline("%s returns to %s shop.", Shknam(shkp),
+ noit_mhis(shkp));
+ vanished = FALSE; /* don't give 'Shk disappears' message */
+ }
} else {
/* if sensed, does disappear regardless whether seen */
if (sensemon(shkp))
!animal ? cad(TRUE) : "", cost_of_damage,
currency(cost_of_damage), !animal ? "\"" : "");
if (yn(qbuf) != 'n') {
+ boolean is_seen, was_seen = canseemon(shkp),
+ was_outside = !inhishop(shkp);
+ xchar sx = shkp->mx, sy = shkp->my;
+
cost_of_damage = check_credit(cost_of_damage, shkp);
if (cost_of_damage > 0L) {
money2mon(shkp, cost_of_damage);
/* move shk back to his home loc */
home_shk(shkp, FALSE);
pacify_shk(shkp);
+ /* home_shk() suppresses rloc()'s vanish/appear messages */
+ if (shkp->mx != sx || shkp->my != sy) {
+ if (was_outside && canspotmon(shkp))
+ pline("%s returns to %s shop.", Shknam(shkp),
+ noit_mhis(shkp));
+ else if ((is_seen = canseemon(shkp)) == TRUE || was_seen)
+ pline("%s %s.", Shknam(shkp), !was_seen ? "appears"
+ : is_seen ? "shifts location"
+ : "disappears");
+ }
} else {
if (!animal) {
if (!Deaf && !muteshk(shkp))