From 8652262105cec817080ecd5c6d3f4ab26ad1969b Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 4 Jun 2024 14:53:17 -0700 Subject: [PATCH] DEBUGFILES Fetching a value of DEBUGFILES from the environment to enable debugpline() messages was intended to operate in wizard mode only but that wasn't enforced. --- doc/fixes3-7-0.txt | 1 + src/files.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index fc8ce49e3..fc66d4e59 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1414,6 +1414,7 @@ shopkeepers magnified the cost of shop items used up as a group; normally the tile for Ixoth (knight's quest nemesis) depicted a demon rather than a dragon; change it to be a red dragon untrapping containers or doors gives some experience +only honor DEBUGFILES (for activating debugpline() calls) when in wizard mode Fixes to 3.7.0-x General Problems Exposed Via git Repository diff --git a/src/files.c b/src/files.c index 8c69e9399..5a39296cd 100644 --- a/src/files.c +++ b/src/files.c @@ -4519,6 +4519,11 @@ debugcore(const char *filename, boolean wildcards) { const char *debugfiles, *p; + /* debugpline() messages might disclose information that the player + doesn't normally get to see, so only display them in wizard mode */ + if (!wizard) + return FALSE; + if (!filename || !*filename) return FALSE; /* sanity precaution */