From 7268c25ef5a5504caf8345aefa9d569284e01e39 Mon Sep 17 00:00:00 2001 From: nullsystem <15316579+nullsystem@users.noreply.github.com> Date: Mon, 3 Aug 2026 21:51:34 +0100 Subject: [PATCH] Readyup - Fixup and refactor checks Make sure it only triggers readyup for gamemodes that deals with readyup, if not, just go on as if readyup not a thing. --- src/game/client/neo/ui/neo_hud_round_state.cpp | 4 +--- src/game/client/neo/ui/neo_scoreboard.cpp | 6 +----- src/game/shared/neo/neo_gamerules.cpp | 14 ++++++++++---- src/game/shared/neo/neo_gamerules.h | 1 + 4 files changed, 13 insertions(+), 12 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 1274ee4f2..4aae1bed4 100644 --- a/src/game/client/neo/ui/neo_hud_round_state.cpp +++ b/src/game/client/neo/ui/neo_hud_round_state.cpp @@ -245,8 +245,6 @@ void CNEOHud_RoundState::ApplySchemeSettings(vgui::IScheme* pScheme) SetZPos(90); } -extern ConVar sv_neo_readyup_lobby; - void CNEOHud_RoundState::UpdateStateForNeoHudElementDraw() { float roundTimeLeft = NEORules()->GetRoundRemainingTime(); @@ -258,7 +256,7 @@ void CNEOHud_RoundState::UpdateStateForNeoHudElementDraw() m_pWszStatusUnicode = L""; if (roundStatus == NeoRoundStatus::Idle) { - m_pWszStatusUnicode = sv_neo_readyup_lobby.GetBool() ? L"Waiting for players to ready up" : L"Waiting for players"; + m_pWszStatusUnicode = NEORules()->IsReadyUpEnabled() ? L"Waiting for players to ready up" : L"Waiting for players"; } else if (roundStatus == NeoRoundStatus::Warmup) { diff --git a/src/game/client/neo/ui/neo_scoreboard.cpp b/src/game/client/neo/ui/neo_scoreboard.cpp index d1175f215..ff794ca38 100644 --- a/src/game/client/neo/ui/neo_scoreboard.cpp +++ b/src/game/client/neo/ui/neo_scoreboard.cpp @@ -23,7 +23,6 @@ ConVar neo_show_scoreboard_avatars("neo_show_scoreboard_avatars", "1", FCVAR_ARC ConVar cl_neo_hud_scoreboard_padding("cl_neo_hud_scoreboard_padding", "0", FCVAR_ARCHIVE, "Adjust scoreboard space padding. 0 = default, 1 = compact, 2 = spacious", true, 0.0f, true, 2.0f); extern ConVar cl_neo_streamermode; extern ConVar cl_neo_squad_hud_original; -extern ConVar sv_neo_readyup_lobby; extern ConVar cl_neo_hud_team_swap_sides; enum ENeoScoreBoardPopup @@ -583,10 +582,7 @@ void CNEOScoreBoard::OnMainLoop(const NeoUI::Mode eMode) const int iAvatarOffset = m_uiCtx.iMarginX; const int iAvatarWT = ShowAvatars() ? (iPopupCardPerRowTallAvatarName - (iAvatarOffset * 2)) : 0; const bool bIsTeamplay = NEORules()->IsTeamplay(); - const int iGameType = NEORules()->GetGameType(); - const bool bShowReadyUp = sv_neo_readyup_lobby.GetBool() - && NEORules()->m_nRoundStatus == NeoRoundStatus::Idle - && NEO_GAME_TYPE_SETTINGS[iGameType].comp; + const bool bShowReadyUp = NEORules()->InReadyUpState(); const bool bShowDamageInfo = pLocalPlayer->IsPlayerDead() && NEORules()->InRoundState() && g_neoKillerInfos.bHasDmgInfos diff --git a/src/game/shared/neo/neo_gamerules.cpp b/src/game/shared/neo/neo_gamerules.cpp index 7c22bc578..722765904 100644 --- a/src/game/shared/neo/neo_gamerules.cpp +++ b/src/game/shared/neo/neo_gamerules.cpp @@ -910,7 +910,7 @@ void CNEORules::ResetMapSessionCommon() void CNEORules::ChangeLevel(void) { ResetMapSessionCommon(); - if (!m_bRotatingMapRightNow && sv_neo_readyup_lobby.GetBool() && !sv_neo_readyup_autointermission.GetBool()) + if (!m_bRotatingMapRightNow && IsReadyUpEnabled() && !sv_neo_readyup_autointermission.GetBool()) { m_bChangelevelDone = false; } @@ -1371,7 +1371,7 @@ void CNEORules::Think(void) gameeventmanager->FireEvent(event); } - if (sv_neo_readyup_lobby.GetBool() && !sv_neo_readyup_autointermission.GetBool()) + if (IsReadyUpEnabled() && !sv_neo_readyup_autointermission.GetBool()) { ResetMapSessionCommon(); } @@ -2689,7 +2689,7 @@ void CNEORules::StartNextRound() || GetGlobalTeam(TEAM_JINRAI)->GetNumPlayers() != GetGlobalTeam(TEAM_NSF)->GetNumPlayers())) ) { - if (sv_neo_readyup_lobby.GetBool()) + if (bLobby) { bool bPrintHelpInfo = (m_iPrintHelpCounter == 0); if (!m_bIgnoreOverThreshold && (readyPlayers.array[TEAM_JINRAI] > iThres || readyPlayers.array[TEAM_NSF] > iThres)) @@ -4735,9 +4735,15 @@ bool CNEORules::IsJuggernautLocked() const return false; } +bool CNEORules::IsReadyUpEnabled() const +{ + return (sv_neo_readyup_lobby.GetBool() + && NEO_GAME_TYPE_SETTINGS[m_nGameTypeSelected].comp); +} + bool CNEORules::InReadyUpState() const { - return (sv_neo_readyup_lobby.GetBool() && m_nRoundStatus == NeoRoundStatus::Idle); + return (IsReadyUpEnabled() && m_nRoundStatus == NeoRoundStatus::Idle); } bool CNEORules::InRoundState() const diff --git a/src/game/shared/neo/neo_gamerules.h b/src/game/shared/neo/neo_gamerules.h index 9c473156f..8d811cab5 100644 --- a/src/game/shared/neo/neo_gamerules.h +++ b/src/game/shared/neo/neo_gamerules.h @@ -369,6 +369,7 @@ class CNEORules : public CHL2MPRules, public CGameEventListener const Vector& GetJuggernautMarkerPos() const; bool IsJuggernautLocked() const; + bool IsReadyUpEnabled() const; bool InReadyUpState() const; bool InRoundState() const;