From e724034995a6a3d91b3154e3b426bc95f6c6c652 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 6 Dec 2022 10:57:14 -0800 Subject: [PATCH] unpaid sanity_check: leaving shop via recoil Throwing while levitating or getting hit for knockback effect could move hero carrying unpaid items out of a shop. If that happened, sanity_check complained that unpaid items weren't in a tended shop. Check for entering and leaving special rooms during recoil same as gets done for ordinary movement. Leaving a shop via recoil or knockback while owing a bill now gets treated as robbery immediately rather than waiting until hero voluntarily moves to another spot after recoil has finished. --- doc/fixes3-7-0.txt | 6 ++++++ src/dothrow.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index fbafc3f6f..c969c2f0e 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1065,6 +1065,9 @@ map browsing during gold detection didn't describe fake gold marking traps if hero's action caused engulfer to expel swallowed hero, it might do so onto a level teleporter and then have its memory accessed after being freed when current level was saved in order to load destination level +throwing recoil while levitating could send hero out of shop while carrying + unpaid items, triggering sanity check warnings; once outside, taking + a step other than back into the shop was treated as a robbery Fixes to 3.7.0-x Problems that Were Exposed Via git Repository @@ -1435,6 +1438,9 @@ the #saveoptions command included options changed via doset_simple() but not fix 'nethack --scores' as alias for 'nethack -s' adding command line 'nethack --usage' broke 'nethack -u name' (however, 'nethack -uname' still worked for names other than "sage") +being hit by a big monster and getting knockback effect could send hero out + of a shop (or into its "free spot") while carrying unpaid goods; + robbery wasn't noticed until hero eventually moved to a different spot curses: 'msg_window' option wasn't functional for curses unless the binary also included tty support diff --git a/src/dothrow.c b/src/dothrow.c index 435f363de..1a1bfc3ea 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -917,6 +917,10 @@ hurtle_step(genericptr_t arg, coordxy x, coordxy y) if (levl[u.ux][u.uy].typ != levl[ox][oy].typ) switch_terrain(); + /* might be entering a special room (treasure zoo, thrown room, &c) that + has a first-time entry message, or leaving shop with unpaid goods */ + check_special_room(FALSE); + if (is_pool(x, y) && !u.uinwater) { if ((Is_waterlevel(&u.uz) && is_waterwall(x,y)) || !(Levitation || Flying || Wwalking)) {