- fixed crash on setting particular CVARs

Game crashed when any of gl_brightfog, gl_lightadditivesurfaces, gl_notexturefill CVARs is set with no level loaded
There was impossible to reset settings to defaults because of this
This commit is contained in:
alexey.lysiuk 2018-07-07 12:04:41 +03:00
parent 2a59327aeb
commit 55ae431c02
1 changed files with 3 additions and 3 deletions

View File

@ -106,17 +106,17 @@ void G_VerifySkill();
CUSTOM_CVAR(Bool, gl_brightfog, false, CVAR_ARCHIVE | CVAR_NOINITCALL)
{
if (level.info->brightfog == -1) level.brightfog = self;
if (level.info == nullptr || level.info->brightfog == -1) level.brightfog = self;
}
CUSTOM_CVAR(Bool, gl_lightadditivesurfaces, false, CVAR_ARCHIVE | CVAR_NOINITCALL)
{
if (level.info->lightadditivesurfaces == -1) level.lightadditivesurfaces = self;
if (level.info == nullptr || level.info->lightadditivesurfaces == -1) level.lightadditivesurfaces = self;
}
CUSTOM_CVAR(Bool, gl_notexturefill, false, CVAR_NOINITCALL)
{
if (level.info->notexturefill == -1) level.notexturefill = self;
if (level.info == nullptr || level.info->notexturefill == -1) level.notexturefill = self;
}
CUSTOM_CVAR(Int, gl_lightmode, 3, CVAR_ARCHIVE | CVAR_NOINITCALL)