From 714ecf9651fb035e6211138cb7cf2e536a6eeb0c Mon Sep 17 00:00:00 2001 From: Lev Date: Tue, 27 Dec 2016 18:47:17 +0500 Subject: [PATCH] Fixed decals.wad loading fallback to DEFAULTGAME directory if mod doesn't supply it (like in AG). --- rehlds/engine/decals.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rehlds/engine/decals.cpp b/rehlds/engine/decals.cpp index e36c4fd..308fab0 100644 --- a/rehlds/engine/decals.cpp +++ b/rehlds/engine/decals.cpp @@ -525,6 +525,9 @@ void Decal_Init(void) FileHandle_t hfile; cachewad_t *decal_wad_temp; char pszPathID[2][15] = { "DEFAULTGAME", "GAME" }; +#ifdef REHLDS_FIXES + bool found = false; +#endif Draw_DecalShutdown(); for (i = 0; i < ARRAYSIZE(pszPathID); i++) @@ -532,7 +535,7 @@ void Decal_Init(void) hfile = FS_OpenPathID("decals.wad", "rb", pszPathID[i]); #ifdef REHLDS_FIXES if (!hfile) - if (i < ARRAYSIZE(pszPathID) - 1) + if (found || i < ARRAYSIZE(pszPathID) - 1) continue; else #else @@ -540,6 +543,10 @@ void Decal_Init(void) #endif Sys_Error("Couldn't find '%s' in \"%s\" search path\n", "decals.wad", pszPathID[i]); +#ifdef REHLDS_FIXES + found = true; +#endif + filesize = FS_Size(hfile); decal_wad_temp = (cachewad_t *)Mem_Malloc(sizeof(cachewad_t)); Q_memset(decal_wad_temp, 0, sizeof(cachewad_t));