From a858967762fb31ea17abd72177d26340c5369d2f Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 6 Mar 2019 18:06:16 -0800 Subject: [PATCH] Check that G_FindView actually found a view --- src/g_game.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index 19b062da..82800346 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2249,10 +2249,13 @@ void G_ResetView(UINT8 viewnum, INT32 playernum, boolean onlyactive) R_ExecuteSetViewSize(); } + /* Check if anyone is available to view. */ + if (( playernum = G_FindView(playernum, viewnum, onlyactive) ) == -1) + return; /* Focus our target view first so that we don't take its player. */ displayplayerp = (G_GetDisplayplayerPtr(viewnum)); olddisplayplayer = (*displayplayerp); - (*displayplayerp) = G_FindView(playernum, viewnum, onlyactive); + (*displayplayerp) = playernum; if ((*displayplayerp) != olddisplayplayer) { camerap = (P_GetCameraPtr(viewnum));