- fixed: ChangeSpy didn't check if a player's camera's player pointer was valid before using it to get an index into the players table.

This commit is contained in:
Christoph Oelckers 2013-07-30 09:16:27 +02:00
parent bc71d4537e
commit 805de60aa4

View file

@ -862,7 +862,10 @@ static void ChangeSpy (int changespy)
int pnum = consoleplayer;
if (changespy != SPY_CANCEL)
{
pnum = int(players[consoleplayer].camera->player - players);
player_t *player = players[consoleplayer].camera->player;
// only use the camera as starting index if it's a valid player.
if (player != NULL) pnum = int(players[consoleplayer].camera->player - players);
int step = (changespy == SPY_NEXT) ? 1 : -1;
do