Let viewpoints underwrap

This means that if you're currently viewing the first
player in game and try to switch view to the player before
them, it will wrap around and view the last player in
game.
This commit is contained in:
James R 2023-02-26 02:19:19 -08:00
parent 14e89d3f42
commit 7a67aa2f35

View file

@ -1964,7 +1964,7 @@ boolean G_CanView(INT32 playernum, UINT8 viewnum, boolean onlyactive)
INT32 G_FindView(INT32 startview, UINT8 viewnum, boolean onlyactive, boolean reverse)
{
INT32 i, dir = reverse ? -1 : 1;
startview = min(max(startview, 0), MAXPLAYERS);
startview = min(max(startview, -1), MAXPLAYERS);
for (i = startview; i < MAXPLAYERS && i >= 0; i += dir)
{
if (G_CanView(i, viewnum, onlyactive))