titlemap - fix game crash with skybox point

game crash on skybox object use fix
This commit is contained in:
yellowtd 2017-04-03 22:12:53 -04:00
parent eea7dc4224
commit b68d1ebdb3
2 changed files with 36 additions and 4 deletions

View file

@ -1436,9 +1436,42 @@ void F_StartTitleScreen(void)
if (!mapheaderinfo[gamemap-1])
P_AllocMapHeader(gamemap-1);
maptol = mapheaderinfo[gamemap-1]->typeoflevel;
globalweather = mapheaderinfo[gamemap-1]->weather;
G_DoLoadLevel(true);
players[displayplayer].playerstate = PST_DEAD; // Don't spawn the player in dummy (I'm still a filthy cheater)
camera.subsector = NULL; // toast is filthy too
//camera.subsector = NULL; // toast is filthy too
// Set Default Position
mapthing_t *startpos;
if (playerstarts[0])
startpos = playerstarts[0];
else if (deathmatchstarts[0])
startpos = deathmatchstarts[0];
else
startpos = NULL;
if (startpos)
{
camera.x = startpos->x << FRACBITS;
camera.y = startpos->y << FRACBITS;
camera.subsector = R_PointInSubsector(camera.x, camera.y);
camera.z = camera.subsector->sector->floorheight + ((startpos->options >> ZSHIFT) << FRACBITS);
camera.angle = (startpos->angle % 360)*ANG1;
camera.aiming = 0;
}
else
{
camera.x = camera.y = camera.z = camera.angle = camera.aiming = 0;
camera.subsector = NULL; // toast is filthy too
}
camera.chase = true;
camera.height = 0;
//camera.x = camera.y = camera.height = camera.aiming = 0;
//camera.z = 128*FRACUNIT;
//CON_ClearHUD();
wipegamestate = prevwipegamestate;
@ -1545,8 +1578,7 @@ void F_TitleScreenTicker(boolean run)
// Do a lil' camera spin if a title map is loaded.
if (titlemapinaction) {
camera.x = camera.y = camera.height = camera.aiming = 0;
camera.z = 128*FRACUNIT;
// Default behavior
camera.angle += titlescrollspeed;
}

View file

@ -1000,7 +1000,7 @@ void R_SetupFrame(player_t *player, boolean skybox)
chasecam = (cv_chasecam.value != 0);
}
if (player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD)
if (player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD || gamestate == GS_TITLESCREEN)
chasecam = true; // force chasecam on
else if (player->spectator) // no spectator chasecam
chasecam = false; // force chasecam off