diff --git a/src/g_game.c b/src/g_game.c index 6dca67fb..7a81aea5 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2133,13 +2133,13 @@ boolean G_CouldView(INT32 playernum) // G_CanView // Return whether a player can be viewed on a particular view (splitscreen). // -boolean G_CanView(INT32 playernum, UINT8 viewnum) +boolean G_CanView(INT32 playernum, UINT8 viewnum, boolean onlyactive) { UINT8 splits; UINT8 viewd; INT32 *displayplayerp; - if (!G_CouldView(playernum)) + if (!(onlyactive ? G_CouldView(playernum) : (playeringame[playernum] && !players[playernum].spectator))) return false; splits = splitscreen+1; @@ -2173,12 +2173,12 @@ INT32 G_FindView(INT32 startview, UINT8 viewnum, boolean onlyactive) startview = min(max(startview, 0), MAXPLAYERS); for (i = startview; i < MAXPLAYERS; ++i) { - if (onlyactive ? G_CanView(i, viewnum) : (playeringame[i] && !players[i].spectator)) + if (G_CanView(i, viewnum, onlyactive)) return i; } for (i = 0; i < startview; ++i) { - if (onlyactive ? G_CanView(i, viewnum) : (playeringame[i] && !players[i].spectator)) + if (G_CanView(i, viewnum, onlyactive)) return i; } return -1; diff --git a/src/g_game.h b/src/g_game.h index 20edb333..0042e4bf 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -235,7 +235,7 @@ boolean G_Responder(event_t *ev); INT32 *G_GetDisplayplayerPtr(UINT8 viewnum); boolean G_CouldView(INT32 playernum); -boolean G_CanView(INT32 playernum, UINT8 viewnum); +boolean G_CanView(INT32 playernum, UINT8 viewnum, boolean onlyactive); INT32 G_FindView(INT32 startview, UINT8 viewnum, boolean onlyactive); INT32 G_CountPlayersPotentiallyViewable(boolean active);