2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-02-28 06:21:10 +03:00

Fixed decals.wad loading fallback to DEFAULTGAME directory if mod doesn't supply it (like in AG).

This commit is contained in:
Lev 2016-12-27 18:47:17 +05:00
parent da17250678
commit 714ecf9651

View File

@ -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));