2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-06 03:55:32 +03:00

Merge pull request #290 from dreamstalker/Decal_Init_fix

Fixed decals.wad loading fallback to DEFAULTGAME directory.
This commit is contained in:
theAsmodai 2016-12-27 19:27:40 +03:00 committed by GitHub
commit 9c59407c9a

View File

@ -525,6 +525,9 @@ void Decal_Init(void)
FileHandle_t hfile; FileHandle_t hfile;
cachewad_t *decal_wad_temp; cachewad_t *decal_wad_temp;
char pszPathID[2][15] = { "DEFAULTGAME", "GAME" }; char pszPathID[2][15] = { "DEFAULTGAME", "GAME" };
#ifdef REHLDS_FIXES
bool found = false;
#endif
Draw_DecalShutdown(); Draw_DecalShutdown();
for (i = 0; i < ARRAYSIZE(pszPathID); i++) for (i = 0; i < ARRAYSIZE(pszPathID); i++)
@ -532,7 +535,7 @@ void Decal_Init(void)
hfile = FS_OpenPathID("decals.wad", "rb", pszPathID[i]); hfile = FS_OpenPathID("decals.wad", "rb", pszPathID[i]);
#ifdef REHLDS_FIXES #ifdef REHLDS_FIXES
if (!hfile) if (!hfile)
if (i < ARRAYSIZE(pszPathID) - 1) if (found || i < ARRAYSIZE(pszPathID) - 1)
continue; continue;
else else
#else #else
@ -540,6 +543,10 @@ void Decal_Init(void)
#endif #endif
Sys_Error("Couldn't find '%s' in \"%s\" search path\n", "decals.wad", pszPathID[i]); 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); filesize = FS_Size(hfile);
decal_wad_temp = (cachewad_t *)Mem_Malloc(sizeof(cachewad_t)); decal_wad_temp = (cachewad_t *)Mem_Malloc(sizeof(cachewad_t));
Q_memset(decal_wad_temp, 0, sizeof(cachewad_t)); Q_memset(decal_wad_temp, 0, sizeof(cachewad_t));