From bc9cb7f7b8e6ffe68dbf617f1f3236f271a91b2c Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 29 Dec 2021 02:21:13 -0800 Subject: [PATCH] no USED_SOUNDS option parsing bit If the program is build without USER_SOUNDS and encounters any SOUND or SOUNDDIR directive when parsing the run-time config file it only issues an error message about the first one. When finished parsing, have it include suppressed ones in the count of errors encountered. --- src/files.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/files.c b/src/files.c index 084ac4c57..0a8276821 100644 --- a/src/files.c +++ b/src/files.c @@ -2975,6 +2975,15 @@ config_error_done(void) if (!config_error_data) return 0; n = config_error_data->num_errors; +#ifndef USER_SOUNDS + if (g.no_sound_notified > 0) { + /* no USER_SOUNDS; config_error_add() was called once for first + SOUND or SOUNDDIR entry seen, then skipped for any others; + include those skipped ones in the total error count */ + n += (g.no_sound_notified - 1); + g.no_sound_notified = 0; + } +#endif if (n) { pline("\n%d error%s in %s.\n", n, plur(n), *config_error_data->source ? config_error_data->source