Make P_EndingMusic *also* operate on local players rather than display players.

This commit is contained in:
toaster 2022-03-12 19:32:03 +00:00
parent 31db72256d
commit a45b163bd1

View file

@ -726,14 +726,16 @@ boolean P_EndingMusic(player_t *player)
if (r_splitscreen) if (r_splitscreen)
{ {
if (!((players[displayplayers[0]].exiting || (players[displayplayers[0]].pflags & PF_NOCONTEST)) INT32 *localplayertable = (splitscreen_partied[consoleplayer] ? splitscreen_party[consoleplayer] : g_localplayers);
|| (players[displayplayers[1]].exiting || (players[displayplayers[1]].pflags & PF_NOCONTEST))
|| ((r_splitscreen < 2) && (players[displayplayers[2]].exiting || (players[displayplayers[2]].pflags & PF_NOCONTEST))) if (!((players[localplayertable[0]].exiting || (players[localplayertable[0]].pflags & PF_NOCONTEST))
|| ((r_splitscreen < 3) && (players[displayplayers[3]].exiting || (players[displayplayers[3]].pflags & PF_NOCONTEST))))) || (players[localplayertable[1]].exiting || (players[localplayertable[1]].pflags & PF_NOCONTEST))
|| ((r_splitscreen < 2) && (players[localplayertable[2]].exiting || (players[localplayertable[2]].pflags & PF_NOCONTEST)))
|| ((r_splitscreen < 3) && (players[localplayertable[3]].exiting || (players[localplayertable[3]].pflags & PF_NOCONTEST)))))
return false; return false;
bestlocalplayer = &players[displayplayers[0]]; bestlocalplayer = &players[localplayertable[0]];
bestlocalpos = getplayerpos(displayplayers[0]); bestlocalpos = getplayerpos(localplayertable[0]);
#define setbests(p) \ #define setbests(p) \
test = getplayerpos(p); \ test = getplayerpos(p); \
if (test < bestlocalpos) \ if (test < bestlocalpos) \
@ -741,11 +743,11 @@ boolean P_EndingMusic(player_t *player)
bestlocalplayer = &players[p]; \ bestlocalplayer = &players[p]; \
bestlocalpos = test; \ bestlocalpos = test; \
} }
setbests(displayplayers[1]); setbests(localplayertable[1]);
if (r_splitscreen > 1) if (r_splitscreen > 1)
setbests(displayplayers[2]); setbests(localplayertable[2]);
if (r_splitscreen > 2) if (r_splitscreen > 2)
setbests(displayplayers[3]); setbests(localplayertable[3]);
#undef setbests #undef setbests
} }
else else