Skip to content

Commit

Permalink
Fix CTF post-game stats panel not showing up
Browse files Browse the repository at this point in the history
Resolves #43
  • Loading branch information
SamVanheer committed Jan 29, 2022
1 parent 968ff0e commit 4acc8a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cl_dll/vgui_TeamFortressViewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1568,10 +1568,11 @@ void TeamFortressViewport::ShowVGUIMenu(int iMenu)
if (0 != gEngfuncs.pDemoAPI->IsPlayingback())
return;

// Don't open any menus except the MOTD during intermission
// Don't open any menus except the MOTD or stats menu during intermission
// MOTD needs to be accepted because it's sent down to the client
// after map change, before intermission's turned off
if (gHUD.m_iIntermission && iMenu != MENU_INTRO)
// Stats menu is displayed during intermission.
if (gHUD.m_iIntermission && (iMenu != MENU_INTRO && iMenu != MENU_STATSMENU))
return;

// Don't create one if it's already in the list
Expand Down
3 changes: 2 additions & 1 deletion dlls/ctf/ctfplay_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,11 +483,12 @@ void CHalfLifeCTFplay::Think()
break;
case StatsPhase::OpenMenu:
MESSAGE_BEGIN(MSG_ALL, gmsgVGUIMenu);
g_engfuncs.pfnWriteByte(9);
g_engfuncs.pfnWriteByte(MENU_STATSMENU);
MESSAGE_END();
m_iStatsPhase = StatsPhase::Nothing;
break;
case StatsPhase::SendPlayers:
//Send up to 5 players worth of stats at a time until we've sent everything.
for (int iStat = 0; iStat <= 5 && m_iStatsPlayer <= gpGlobals->maxClients; ++m_iStatsPlayer)
{
auto pPlayer = UTIL_PlayerByIndex(m_iStatsPlayer);
Expand Down

0 comments on commit 4acc8a7

Please sign in to comment.