2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-19 01:58:02 +03:00

Set skyname to default if it is not exists or is empty

This commit is contained in:
WPMGPRoSToTeMa 2016-02-07 17:18:52 +03:00
parent e2cc869086
commit 7f21a5bc54

View File

@ -5002,9 +5002,7 @@ void EXT_FUNC SV_AddResource(resourcetype_t type, const char *name, int size, un
}
#ifdef REHLDS_FIXES
void PrecacheMapSpecifiedResources()
{
if (sv_skyname.string[0])
bool PrecacheSky()
{
// TODO: what to do if these files only on fastdl? add cvar onlytga?
if (FS_FileExists(va("gfx/env/%sbk.tga", sv_skyname.string)))
@ -5015,8 +5013,10 @@ void PrecacheMapSpecifiedResources()
PF_precache_generic_I(va("gfx/env/%slf.tga", sv_skyname.string));
PF_precache_generic_I(va("gfx/env/%srt.tga", sv_skyname.string));
PF_precache_generic_I(va("gfx/env/%sup.tga", sv_skyname.string));
return true;
}
else
else if (FS_FileExists(va("gfx/env/%sbk.bmp", sv_skyname.string)))
{
PF_precache_generic_I(va("gfx/env/%sbk.bmp", sv_skyname.string));
PF_precache_generic_I(va("gfx/env/%sdn.bmp", sv_skyname.string));
@ -5024,7 +5024,19 @@ void PrecacheMapSpecifiedResources()
PF_precache_generic_I(va("gfx/env/%slf.bmp", sv_skyname.string));
PF_precache_generic_I(va("gfx/env/%srt.bmp", sv_skyname.string));
PF_precache_generic_I(va("gfx/env/%sup.bmp", sv_skyname.string));
return true;
}
return false;
}
void PrecacheMapSpecifiedResources()
{
if (sv_skyname.string[0] == '\0' || !PrecacheSky())
{
Cvar_Set(sv_skyname.name, "desert");
PrecacheSky();
}
// TODO: or this is not-engine and this better do by gamedll or .res?