^P vs sanity_check
Normally when sanity_check is enabled it will take place for every command executed. Avoid that when the command is ^P because if a sanity warning is a recurring one and the msg_window setting is single or combination (tty-only) which shows one message, ^P will just repeat each new warning without having any chance to cycle back to earlier messages.
This commit is contained in:
@@ -1187,6 +1187,9 @@ don't exclude map column 1 from consideration when rloc() picks a random spot
|
||||
for destination of a teleported monster
|
||||
covetous monster attacking another monster to acquire special item would not
|
||||
do so if positioned diagonally adjacent
|
||||
skip sanity_check handling when current command is ^P, otherwise it might
|
||||
re-trigger and show new sanity warning every time when set for
|
||||
line-at-a-line feedback
|
||||
|
||||
|
||||
Fixes to 3.7.0-x General Problems Exposed Via git Repository
|
||||
|
||||
11
src/cmd.c
11
src/cmd.c
@@ -188,11 +188,14 @@ static const char *readchar_queue = "";
|
||||
static const char unavailcmd[] = "Unavailable command '%s'.";
|
||||
/* for rejecting #if !SHELL, !SUSPEND */
|
||||
static const char cmdnotavail[] = "'%s' command not available.";
|
||||
/* doesn't need to be in struct g|gw */
|
||||
static boolean was_doprev = FALSE;
|
||||
|
||||
/* the #prevmsg command */
|
||||
static int
|
||||
doprev_message(void)
|
||||
{
|
||||
was_doprev = TRUE;
|
||||
(void) nh_doprev_message();
|
||||
return ECMD_OK;
|
||||
}
|
||||
@@ -4265,6 +4268,14 @@ you_sanity_check(void)
|
||||
void
|
||||
sanity_check(void)
|
||||
{
|
||||
if (was_doprev) {
|
||||
/* in case a recurring sanity_check warning occurs, we mustn't
|
||||
re-trigger it when ^P is used, otherwise msg_window:Single
|
||||
and msg_window:Combination will always repeat the most recent
|
||||
instance, never able to go back to any earlier messages */
|
||||
was_doprev = FALSE;
|
||||
return;
|
||||
}
|
||||
you_sanity_check();
|
||||
obj_sanity_check();
|
||||
timer_sanity_check();
|
||||
|
||||
Reference in New Issue
Block a user