From dca0bbcbb14c2a34ecdd83b7bb817a3df89913c8 Mon Sep 17 00:00:00 2001 From: Vincent Herbet Date: Wed, 7 Aug 2013 16:44:25 +0200 Subject: [PATCH] Fix tfcstats_rankbots not working as expected when disabled (bug 3192, r=Nextra) Former-commit-id: 2ed695c8bbb1d69dc9241af18fb0477b1f19cce8 --- dlls/tfcx/CMisc.cpp | 2 +- dlls/tfcx/Utils.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/tfcx/CMisc.cpp b/dlls/tfcx/CMisc.cpp index 96f7f980..e4384490 100755 --- a/dlls/tfcx/CMisc.cpp +++ b/dlls/tfcx/CMisc.cpp @@ -106,7 +106,7 @@ void CPlayer::PutInServer(){ ingame = true; - if ( ignoreBots(pEdict) ) + if ((int)tfcstats_rankbots->value == 0 && IsBot()) // ignoreBots() can't be used as bot's flags are not set yet. return; restartStats(); diff --git a/dlls/tfcx/Utils.cpp b/dlls/tfcx/Utils.cpp index 0672675a..ec867908 100755 --- a/dlls/tfcx/Utils.cpp +++ b/dlls/tfcx/Utils.cpp @@ -48,7 +48,9 @@ traceVault traceData[] = { { "tf_weapon_concussiongrenade","co", TFC_WPN_CONCUSSIONGRENADE, ACT_NADE_NONE, 0.0 , 10 , 2 }, }; -bool ignoreBots (edict_t *pEnt, edict_t *pOther){ +bool ignoreBots (edict_t *pEnt, edict_t *pOther) +{ + rankBots = (int)tfcstats_rankbots->value ? true : false; if ( !rankBots && ( pEnt->v.flags & FL_FAKECLIENT || ( pOther && pOther->v.flags & FL_FAKECLIENT ) ) ) return true; return false;