From a4810bd6c847a82e824a7c6edbac0ce272cbd04b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Thu, 24 Jul 2025 23:30:09 +0200 Subject: [PATCH] Fix custom addon directory being ignored when downloading addons --- src/d_netfil.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/d_netfil.c b/src/d_netfil.c index d45570a0e..650433e44 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -1185,6 +1185,18 @@ filestatus_t findfile(char *filename, const UINT8 *wantedmd5sum, boolean complet badmd5 = true; // if not found at all, just move on without doing anything + if (cv_addons_option.value == 3 && *cv_addons_folder.string != '\0') + { + // next, check any custom directory if specified + homecheck = filesearch(filename, cv_addons_folder.string, wantedmd5sum, completepath, 10); + + if (homecheck == FS_FOUND) // we found the file, so return that we have :) + return FS_FOUND; + else if (homecheck == FS_MD5SUMBAD) // file has a bad md5; move on and look for a file with the right md5 + badmd5 = true; + // if not found at all, just move on without doing anything + } + // finally check "." directory homecheck = filesearch(filename, ".", wantedmd5sum, completepath, 10);