From 9efccb6da929ee8d9199ef92facc372612894364 Mon Sep 17 00:00:00 2001 From: Andrei Drexler Date: Sun, 21 Jul 2024 14:45:41 +0200 Subject: [PATCH] Clean up COM_FindFile debug prints a bit --- Quake/common.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Quake/common.c b/Quake/common.c index 7eb4d3142..8a6fdcee6 100644 --- a/Quake/common.c +++ b/Quake/common.c @@ -1908,13 +1908,19 @@ static int COM_FindFile (const char *filename, int *handle, FILE **file, } } - if (strcmp(COM_FileGetExtension(filename), "pcx") != 0 - && strcmp(COM_FileGetExtension(filename), "tga") != 0 - && strcmp(COM_FileGetExtension(filename), "lit") != 0 - && strcmp(COM_FileGetExtension(filename), "vis") != 0 - && strcmp(COM_FileGetExtension(filename), "ent") != 0) - Con_DPrintf ("FindFile: can't find %s\n", filename); - else Con_DPrintf2("FindFile: can't find %s\n", filename); + if (developer.value) + { + const char *ext = COM_FileGetExtension (filename); + + if (strcmp(ext, "pcx") != 0 && + strcmp(ext, "tga") != 0 && + strcmp(ext, "lit") != 0 && + strcmp(ext, "vis") != 0 && + strcmp(ext, "ent") != 0) + Con_DPrintf ("FindFile: can't find %s\n", filename); + else + Con_DPrintf2 ("FindFile: can't find %s\n", filename); + } if (handle) *handle = -1;