'O' feedback when toggling 'accessiblemsg'

When accessiblemsg is Off, coordiates supplied for various messages
stayed put after becoming stale.  If you used 'mO' to toggle that
option On, you could see things like
 (2east):'accessiblemsg' option toggled on.
After that, accessibility message coordinates behaved as intended.

Clear a11y.msg_loc.x,y for every pline instead of just when they
are used to augment the current message.

Most players who use accessiblemsg are bound to set it in their
config file rather than toggle it interactively so never noticed.

Misc 1:  option.c doesn't need '#include <ctype.h>' because
cstd.h includes it unconditionally.  Several other src/*.c are in
the same situation but I didn't touch them.

Misc 2:  move set_msg_dir() and set_msg_xy() out of a warning
suppression block that isn't relevant to them.
This commit is contained in:
PatR
2024-11-26 19:28:30 -08:00
parent 1c5b295097
commit 3615b17b62
2 changed files with 38 additions and 31 deletions

View File

@@ -3,17 +3,17 @@
/*-Copyright (c) Michael Allison, 2008. */
/* NetHack may be freely redistributed. See license for details. */
#ifdef OPTION_LISTS_ONLY /* (AMIGA) external program for opt lists */
#ifndef OPTION_LISTS_ONLY
#include "hack.h"
#include "tcap.h"
#else /* OPTION_LISTS_ONLY: (AMIGA) external program for opt lists */
#include "config.h"
#include "objclass.h"
#include "flag.h"
NEARDATA struct flag flags; /* provide linkage */
NEARDATA struct instance_flags iflags; /* provide linkage */
NEARDATA struct accessibility_data a11y;
#define static
#else
#include "hack.h"
#include "tcap.h"
#include <ctype.h>
#endif
#define BACKWARD_COMPAT
@@ -5297,6 +5297,9 @@ optfn_boolean(
case opt_rest_on_space:
update_rest_on_space();
break;
case opt_accessiblemsg:
a11y.msg_loc.x = a11y.msg_loc.y = 0;
break;
default:
break;
}