From b177a5782a58c0cbd19398dc77d140dc9f4b0b9b Mon Sep 17 00:00:00 2001 From: Julian Rowe Date: Fri, 28 Apr 2017 10:10:20 -0500 Subject: [PATCH] Made noPush less resource intensive --- src/hacks/Misc.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/hacks/Misc.cpp b/src/hacks/Misc.cpp index 82d9a524..df7ead5f 100644 --- a/src/hacks/Misc.cpp +++ b/src/hacks/Misc.cpp @@ -191,17 +191,9 @@ void CreateMove() { g_pUserCmd->forwardmove = RandFloatRange(-450.0, 450.0); g_pUserCmd->buttons = rand(); } - //Pasted by Julianacat from F1ssion - ConVar * pNoPush = g_ICvar->FindVar( "tf_avoidteammates_pushaway" ); - int nopushvar = nopush_enabled; - if ( nopushvar == (pNoPush -> GetInt()) ) { - if (nopushvar == 1) { - pNoPush->SetValue( 0 ); - } else { - pNoPush->SetValue( 1 ); - } - - } + + static ConVar * pNoPush = g_ICvar->FindVar( "tf_avoidteammates_pushaway" ); + if (nopush_enabled == pNoPush-> GetBool()) pNoPush->SetValue (!nopush_enabled); } void Draw() {