ST_drawDebugInfo: fix displayplayers access out of bounds on startup

On startup, the cvar is not registered yet so the value
went negative subtracting from zero.
This commit is contained in:
James R 2023-04-04 22:08:43 -07:00
parent e5d51d5a31
commit f087d6d865

View file

@ -438,8 +438,10 @@ void ST_drawDebugInfo(void)
{ {
INT32 height = 192; INT32 height = 192;
const UINT8 screen = cv_devmode_screen.value - 1;
// devmode_screen = 1..4 // devmode_screen = 1..4
stplyr = &players[displayplayers[min(r_splitscreen, cv_devmode_screen.value - 1)]]; stplyr = &players[displayplayers[min(r_splitscreen, screen)]];
if (!stplyr->mo) if (!stplyr->mo)
return; return;