From 105075e0f682b7a099d6672971e9b77fca8cd2ff Mon Sep 17 00:00:00 2001 From: In-line Date: Mon, 23 Jan 2017 13:16:03 +0400 Subject: [PATCH] Micro optimization and report recursive shutdown by Sys_Error (#318) * Micro optimization in CheckGore --- rehlds/engine/host.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/rehlds/engine/host.cpp b/rehlds/engine/host.cpp index 2523070..1cc83e4 100644 --- a/rehlds/engine/host.cpp +++ b/rehlds/engine/host.cpp @@ -1008,20 +1008,12 @@ int Host_Frame(float time, int iState, int *stateInfo) void CheckGore(void) { - if (bLowViolenceBuild) - { - Cvar_SetValue("violence_hblood", 0.0); - Cvar_SetValue("violence_hgibs", 0.0); - Cvar_SetValue("violence_ablood", 0.0); - Cvar_SetValue("violence_agibs", 0.0); - } - else - { - Cvar_SetValue("violence_hblood", 1.0); - Cvar_SetValue("violence_hgibs", 1.0); - Cvar_SetValue("violence_ablood", 1.0); - Cvar_SetValue("violence_agibs", 1.0); - } + float fValue = bLowViolenceBuild ? 0.0f : 1.0f; + + Cvar_SetValue("violence_hblood", fValue); + Cvar_SetValue("violence_hgibs", fValue); + Cvar_SetValue("violence_ablood", fValue); + Cvar_SetValue("violence_agibs", fValue); } qboolean Host_IsSinglePlayerGame(void)