From 3e0150d4f31be79d30c99d0d6f8b00a02e85360b Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 1 Nov 2025 20:53:21 +0100 Subject: [PATCH] remove auto/postload check variables we can just check our counts since D_FindAddonsToAutoload will never be called again --- src/d_main.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 7bb932b1b..aa6c905c2 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -106,8 +106,6 @@ static char *autoloadwadfiles[MAX_WADFILES]; static char *autoloadwadfilespost[MAX_WADFILES]; static size_t autoloadcount = 0; static size_t postloadcount = 0; -static boolean autoloaded = false; -static boolean postautoloaded = false; // boolean devparm = false; // started game with -devparm @@ -1160,7 +1158,7 @@ static void D_FindAddonsToAutoload(void) // If the file is found, run our shit if (!autoloadconfigfile) // nope outta here { - autoloaded = postautoloaded = true; // so D_AddAutoloadFiles can skip everything since nothings there to autoload + autoloadcount = postloadcount = 0; // so D_AddAutoloadFiles can skip everything since nothings there to autoload return; } @@ -1214,7 +1212,8 @@ static void D_FindAddonsToAutoload(void) static void D_AddAutoloadFiles(void) { - if (autoloaded) + // nothing to autoload + if (autoloadcount == 0) return; CONS_Printf("D_AutoloadFile(): Loading autoloaded addons...\n"); @@ -1225,12 +1224,12 @@ static void D_AddAutoloadFiles(void) D_CleanFile(autoloadwadfiles, autoloadcount); autoloadcount = 0; - autoloaded = true; } void D_AddPostloadFiles(void) { - if (postautoloaded || !netgame) + // nothing to postload + if (postloadcount == 0 || !netgame) return; CONS_Printf("D_AddPostloadFiles(): Loading postloaded addons...\n"); @@ -1241,7 +1240,6 @@ void D_AddPostloadFiles(void) D_CleanFile(autoloadwadfilespost, postloadcount); postloadcount = 0; - postautoloaded = true; } // ==========================================================================