From bd8552717642f668f129eb26e348dc9267aeacd6 Mon Sep 17 00:00:00 2001 From: Alan Shen Date: Wed, 14 Oct 2026 19:10:13 -0600 Subject: [PATCH 1/2] Read mp_slammoveyaw directly in 9-way move yaw CHL2MPPlayerAnimState::ComputePoseParam_MoveYaw built a ConVarRef by name on every call, so every player's every usercmd on the server (and every frame on the client) did a linear CCvar::FindVar walk over all registered cvars. The ConVar is defined in multiplayer_animstate.cpp, which both DLLs compile, so NEO refers to it with extern instead; other builds keep the by-name lookup. The value read is the same. Co-authored-by: Mikhail Bogdanov --- src/game/shared/hl2mp/hl2mp_playeranimstate.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/game/shared/hl2mp/hl2mp_playeranimstate.cpp b/src/game/shared/hl2mp/hl2mp_playeranimstate.cpp index 9e441acd87..5ecee1cb5e 100644 --- a/src/game/shared/hl2mp/hl2mp_playeranimstate.cpp +++ b/src/game/shared/hl2mp/hl2mp_playeranimstate.cpp @@ -653,6 +653,9 @@ void CHL2MPPlayerAnimState::EstimateYaw( void ) // Input : dt - //----------------------------------------------------------------------------- float SnapYawTo( float flValue ); +#ifdef NEO +extern ConVar mp_slammoveyaw; +#endif void CHL2MPPlayerAnimState::ComputePoseParam_MoveYaw( CStudioHdr *pStudioHdr ) { #ifdef NEO @@ -662,7 +665,9 @@ void CHL2MPPlayerAnimState::ComputePoseParam_MoveYaw( CStudioHdr *pStudioHdr ) EstimateYaw(); #if 1 // 9way +#ifndef NEO ConVarRef mp_slammoveyaw("mp_slammoveyaw"); +#endif // Get the view yaw. float flAngle = AngleNormalize( m_flEyeYaw ); From a5b6ba10a4db0ae8ab87e0b8581098a64e503bde Mon Sep 17 00:00:00 2001 From: Alan Shen Date: Sat, 14 Nov 2026 23:59:25 -0700 Subject: [PATCH 2/2] Read sv_neo_bot_cmdr_enable directly in round HUD The round-state HUD built a ConVarRef for sv_neo_bot_cmdr_enable on every paint and per drawn player row, which searches the console variable list by name each time. The ConVar is defined in shared code compiled into the client, so read it through an extern instead, as neo_hud_context_hint.cpp already does. --- src/game/client/neo/ui/neo_hud_round_state.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/game/client/neo/ui/neo_hud_round_state.cpp b/src/game/client/neo/ui/neo_hud_round_state.cpp index b907e315b3..5d95aef213 100644 --- a/src/game/client/neo/ui/neo_hud_round_state.cpp +++ b/src/game/client/neo/ui/neo_hud_round_state.cpp @@ -45,6 +45,7 @@ extern ConVar sv_neo_readyup_countdown; extern ConVar cl_neo_hud_scoreboard_hide_others; extern ConVar sv_neo_ctg_ghost_overtime_grace; extern ConVar cl_neo_hud_health_mode; +extern ConVar sv_neo_bot_cmdr_enable; namespace { constexpr int Y_POS = 0; @@ -735,9 +736,7 @@ void CNEOHud_RoundState::DrawPlayerList() return; } - ConVarRef cl_neo_bot_cmdr_enable_ref("sv_neo_bot_cmdr_enable"); - Assert(cl_neo_bot_cmdr_enable_ref.IsValid()); - if (cl_neo_bot_cmdr_enable_ref.IsValid() && cl_neo_bot_cmdr_enable_ref.GetBool()) + if (sv_neo_bot_cmdr_enable.GetBool()) { DrawPlayerList_BotCmdr(); return; @@ -921,9 +920,7 @@ void CNEOHud_RoundState::DrawPlayerList_BotCmdr() int CNEOHud_RoundState::DrawPlayerRow(int playerIndex, const int yOffset, bool small) { - ConVarRef cl_neo_bot_cmdr_enable_ref("sv_neo_bot_cmdr_enable"); - Assert(cl_neo_bot_cmdr_enable_ref.IsValid()); - if (cl_neo_bot_cmdr_enable_ref.IsValid() && cl_neo_bot_cmdr_enable_ref.GetBool()) + if (sv_neo_bot_cmdr_enable.GetBool()) { return DrawPlayerRow_BotCmdr(playerIndex, yOffset, small); } @@ -1142,9 +1139,7 @@ void CNEOHud_RoundState::DrawPlayer(int playerIndex, int teamIndex, const TeamLo } // Draw commander selected highlight - ConVarRef cl_neo_bot_cmdr_enable_ref("sv_neo_bot_cmdr_enable"); - Assert(cl_neo_bot_cmdr_enable_ref.IsValid()); - if (cl_neo_bot_cmdr_enable_ref.IsValid() && cl_neo_bot_cmdr_enable_ref.GetBool()) + if (sv_neo_bot_cmdr_enable.GetBool()) { C_NEO_Player* pPlayer = static_cast(UTIL_PlayerByIndex(playerIndex)); if (pPlayer)