Don't reset camera position when spectating

Fixes a software renderer crash due to hitlag VFX from the
player's death (death from spectating) being too close to
the camera.
This commit is contained in:
James R 2023-08-17 17:38:24 -07:00
parent 0036006586
commit 414d6f3647
2 changed files with 9 additions and 4 deletions

View file

@ -12014,12 +12014,15 @@ void P_AfterPlayerSpawn(INT32 playernum)
p->drawangle = mobj->angle;
for (i = 0; i <= r_splitscreen; i++)
if (p->spectator == false)
{
if (camera[i].chase)
for (i = 0; i <= r_splitscreen; i++)
{
if (displayplayers[i] == playernum)
P_ResetCamera(p, &camera[i]);
if (camera[i].chase)
{
if (displayplayers[i] == playernum)
P_ResetCamera(p, &camera[i]);
}
}
}

View file

@ -7735,6 +7735,8 @@ static void P_SetupCamera(UINT8 pnum, camera_t *cam)
cam->subsector = R_PointInSubsector(cam->x, cam->y); // make sure camera has a subsector set -- Monster Iestyn (12/11/18)
}
}
cam->chase = false; // tell camera to reset its position next tic
}
static void P_InitCamera(void)