Merge branch 'master' into next

This commit is contained in:
Monster Iestyn 2018-11-09 23:18:14 +00:00
commit 4b8232d777
2 changed files with 12 additions and 11 deletions

View file

@ -3506,14 +3506,15 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
if (player->pflags & PF_FLIPCAM && !(player->pflags & PF_NIGHTSMODE) && player->mo->eflags & MFE_VERTICALFLIP)
postimg = postimg_flip;
else if (player->awayviewtics)
else if (player->awayviewtics && player->awayviewmobj != NULL) // Camera must obviously exist
{
camera_t dummycam;
dummycam.subsector = player->awayviewmobj->subsector;
dummycam.x = player->awayviewmobj->x;
dummycam.y = player->awayviewmobj->y;
dummycam.z = player->awayviewmobj->z;
dummycam.height = 40*FRACUNIT; // alt view height is 20*FRACUNIT
//dummycam.height = 40*FRACUNIT; // alt view height is 20*FRACUNIT
dummycam.height = 0; // Why? Remote viewpoint cameras have no height.
// Are we in water?
if (P_CameraCheckWater(&dummycam))
postimg = postimg_water;

View file

@ -8371,16 +8371,12 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
// Make player translucent if camera is too close (only in single player).
if (!(multiplayer || netgame) && !splitscreen)
{
fixed_t vx = 0, vy = 0;
if (player->awayviewtics) {
fixed_t vx = thiscam->x, vy = thiscam->y;
if (player->awayviewtics && player->awayviewmobj != NULL) // Camera must obviously exist
{
vx = player->awayviewmobj->x;
vy = player->awayviewmobj->y;
}
else
{
vx = thiscam->x;
vy = thiscam->y;
}
if (P_AproxDistance(vx - mo->x, vy - mo->y) < FixedMul(48*FRACUNIT, mo->scale))
mo->flags2 |= MF2_SHADOW;
@ -8716,8 +8712,9 @@ void P_PlayerThink(player_t *player)
if (player->flashcount)
player->flashcount--;
if (player->awayviewtics)
player->awayviewtics--;
// By the time P_MoveChaseCamera is called, this might be zero. Do not do it here.
//if (player->awayviewtics)
// player->awayviewtics--;
/// \note do this in the cheat code
if (player->pflags & PF_NOCLIP)
@ -9495,6 +9492,9 @@ void P_PlayerAfterThink(player_t *player)
}
}
if (player->awayviewtics)
player->awayviewtics--;
// spectator invisibility and nogravity.
if ((netgame || multiplayer) && player->spectator)
{