integrate 'msgtype' option and Norep()

Allow 'msgtype=show' for messages that nethack uses Norep() for.
I don't know whether anyone will ever want to do that, but if felt
strange to have two different message suppression mechanisms that
were completely disconnected from each other.

For a user with no msgtype filter, there'll be no difference in
behavior.
This commit is contained in:
PatR
2016-01-08 00:38:34 -08:00
parent f16e9a8890
commit db234f743d
3 changed files with 12 additions and 11 deletions
+8 -8
View File
@@ -83,22 +83,22 @@ VA_DECL(const char *, line)
iflags.last_msg = PLNMSG_UNKNOWN;
return;
}
#ifndef MAC
if (no_repeat && !strcmp(line, toplines))
msgtyp = msgtype_type(line, no_repeat);
if (msgtyp == MSGTYP_NOSHOW
|| (msgtyp == MSGTYP_NOREP && !strcmp(line, prevmsg)))
return;
#endif /* MAC */
if (vision_full_recalc)
vision_recalc(0);
if (u.ux)
flush_screen(1); /* %% */
msgtyp = msgtype_type(line);
if (msgtyp == MSGTYP_NOSHOW) return;
if (msgtyp == MSGTYP_NOREP && !strcmp(line, prevmsg)) return;
putstr(WIN_MESSAGE, 0, line);
/* this gets cleared after every pline message */
iflags.last_msg = PLNMSG_UNKNOWN;
strncpy(prevmsg, line, BUFSZ);
if (msgtyp == MSGTYP_STOP) display_nhwindow(WIN_MESSAGE, TRUE); /* --more-- */
strncpy(prevmsg, line, BUFSZ), prevmsg[BUFSZ - 1] = '\0';
if (msgtyp == MSGTYP_STOP)
display_nhwindow(WIN_MESSAGE, TRUE); /* --more-- */
#if !(defined(USE_STDARG) || defined(USE_VARARGS))
/* provide closing brace for the nested block