From e24b62d3e0831cf9e88bc961122e77e65e4befde Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Sat, 30 May 2020 05:41:22 +0200 Subject: [PATCH] Use g_hitEffect CVar variable directly instead of getting it by name No need to do a lookup of the CVar by name every time the player is hit, we can just access the variable holding it. --- neo/d3xp/PlayerView.cpp | 2 +- neo/game/PlayerView.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/neo/d3xp/PlayerView.cpp b/neo/d3xp/PlayerView.cpp index d7676708..750e20d0 100644 --- a/neo/d3xp/PlayerView.cpp +++ b/neo/d3xp/PlayerView.cpp @@ -255,7 +255,7 @@ which will determine the head kick direction ============== */ void idPlayerView::DamageImpulse( idVec3 localKickDir, const idDict *damageDef ) { - if ( cvarSystem->GetCVarBool( "g_hitEffect" ) ) { + if ( g_hitEffect.GetBool() ) { // // double vision effect // diff --git a/neo/game/PlayerView.cpp b/neo/game/PlayerView.cpp index 7bdd35fd..549ce3ab 100644 --- a/neo/game/PlayerView.cpp +++ b/neo/game/PlayerView.cpp @@ -224,7 +224,7 @@ which will determine the head kick direction ============== */ void idPlayerView::DamageImpulse( idVec3 localKickDir, const idDict *damageDef ) { - if ( cvarSystem->GetCVarBool( "g_hitEffect" ) ) { + if ( g_hitEffect.GetBool() ) { // // double vision effect //