From: Pasi Kallinen Date: Tue, 21 Dec 2021 15:37:48 +0000 (+0200) Subject: Apply runmode to multiturn actions X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b1ed92abad2ea4746b008a5ce43b75f1608c1120;p=nethack Apply runmode to multiturn actions --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 6eaba8930..48e6948a6 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -720,6 +720,7 @@ if a leashed pet changed name (#name m) or an unnamed pet changed type attack feedback when using a bullwhip said "swing"; change to "lash" attack feedback for monster using polearm when adjacent said "thrust"; change to "bash" +apply runmode delay to multiturn actions, not just running Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/include/extern.h b/include/extern.h index dacabbb84..3fd48ac1d 100644 --- a/include/extern.h +++ b/include/extern.h @@ -874,6 +874,7 @@ extern int wiz_debug_cmd_traveldisplay(void); #endif extern boolean u_rooted(void); extern void domove(void); +extern void runmode_delay_output(void); extern void overexert_hp(void); extern boolean overexertion(void); extern void invocation_message(void); diff --git a/src/allmain.c b/src/allmain.c index fc7c7e399..0ef1108ef 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -336,6 +336,7 @@ moveloop_core(void) /* when immobile, count is in turns */ if (g.multi < 0) { + runmode_delay_output(); if (++g.multi == 0) { /* finished yet? */ unmul((char *) 0); /* if unmul caused a level change, take it now */ @@ -433,10 +434,7 @@ moveloop_core(void) stop_occupation(); reset_eat(); } -#if defined(MICRO) || defined(WIN32) - if (!(++g.occtime % 7)) - display_nhwindow(WIN_MAP, FALSE); -#endif + runmode_delay_output(); return; } @@ -449,6 +447,7 @@ moveloop_core(void) if (g.multi > 0) { lookaround(); + runmode_delay_output(); if (!g.multi) { /* lookaround may clear multi */ g.context.move = 0; diff --git a/src/hack.c b/src/hack.c index 6ffe51c75..4942c4cdb 100644 --- a/src/hack.c +++ b/src/hack.c @@ -2141,7 +2141,15 @@ domove_core(void) g.nomovemsg = ""; } - if (g.context.run && flags.runmode != RUN_TPORT) { + runmode_delay_output(); +} + +/* delay output based on value of runmode, + if hero is running or doing a multi-turn action */ +void +runmode_delay_output(void) +{ + if ((g.context.run || g.multi) && flags.runmode != RUN_TPORT) { /* for tport mode, don't display anything until we've stopped; for normal (leap) mode, update display every 7th step (relative to turn counter; ought to be to start of running);