SCR_DisplayLocalPing: show, even in splitscreen, in gamestates where player HUD is not drawn or when menu is opened

This commit is contained in:
James R. 2023-10-01 21:14:05 -07:00 committed by James R
parent dd1b0255f8
commit 989ee48ef8

View file

@ -568,15 +568,28 @@ void SCR_DisplayTicRate(void)
void SCR_DisplayLocalPing(void)
{
boolean offline;
UINT32 ping = playerpingtable[consoleplayer]; // consoleplayer's ping is everyone's ping in a splitnetgame :P
if (! r_splitscreen && ( cv_showping.value == 1 || (cv_showping.value == 2 && ping > servermaxping) )) // only show 2 (warning) if our ping is at a bad level
// Splitscreen party has its own ping counter, but show the
// 1P version anyway in some cases:
// - On intermission, vote, etc. gamestates where the player
// HUD is not drawn.
// - If the menu is opened, since it draws over the player
// HUD.
if (r_splitscreen && gamestate == GS_LEVEL && !menuactive)
{
INT32 dispy = cv_ticrate.value ? 160 : 181;
offline = (consoleplayer == serverplayer);
HU_drawPing(307 * FRACUNIT, dispy * FRACUNIT, ping, V_SNAPTORIGHT | V_SNAPTOBOTTOM, offline, 0);
return;
}
UINT32 ping = playerpingtable[consoleplayer];
if (cv_showping.value == 2 && ping <= servermaxping) // only show 2 (warning) if our ping is at a bad level
{
return;
}
INT32 dispy = cv_ticrate.value ? 160 : 181;
boolean offline = (consoleplayer == serverplayer);
HU_drawPing(307 * FRACUNIT, dispy * FRACUNIT, ping, V_SNAPTORIGHT | V_SNAPTOBOTTOM, offline, 0);
}