Camera crash fixes

UNRELATED, but they made this branch a pain in the ass to test so I needed to fix this here :V
This commit is contained in:
TehRealSalt 2018-10-28 17:31:59 -04:00
parent b83286b532
commit 9630e01616
3 changed files with 11 additions and 0 deletions

View File

@ -4033,6 +4033,7 @@ static void M_ForceLoadGameResponse(INT32 ch)
displayplayer = consoleplayer;
multiplayer = false;
splitscreen = 0;
SplitScreen_OnChange(); // not needed?
if (setsizeneeded)
R_ExecuteSetViewSize();
@ -4122,6 +4123,7 @@ void G_LoadGame(UINT32 slot, INT16 mapoverride)
displayplayer = consoleplayer;
multiplayer = false;
splitscreen = 0;
SplitScreen_OnChange(); // not needed?
// G_DeferedInitNew(sk_medium, G_BuildMapName(1), 0, 0, 1);
if (setsizeneeded)

View File

@ -3654,6 +3654,11 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
{
boolean itsatwodlevel = false;
postimg_t postimg = postimg_none;
// This can happen when joining
if (thiscam->subsector == NULL || thiscam->subsector->sector == NULL)
return true;
if (twodlevel
|| (thiscam == &camera && players[displayplayer].mo && (players[displayplayer].mo->flags2 & MF2_TWOD))
|| (thiscam == &camera2 && players[secondarydisplayplayer].mo && (players[secondarydisplayplayer].mo->flags2 & MF2_TWOD))

View File

@ -8083,6 +8083,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
if (!player || !player->mo)
return true;
// This can happen when joining
if (thiscam->subsector == NULL || thiscam->subsector->sector == NULL)
return true;
mo = player->mo;
#ifndef NOCLIPCAM