mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
- 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:
parent
bc71d4537e
commit
805de60aa4
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue