This commit is contained in:
Jimita the Cat 2019-03-06 21:40:38 -03:00
parent 747995ae6a
commit 0186f6784b
2 changed files with 2 additions and 11 deletions

View file

@ -6033,7 +6033,7 @@ void P_RunOverlays(void)
{
angle_t viewingangle;
if (players[displayplayer].awayviewtics)
if (players[displayplayer].awayviewtics && players[displayplayer].awayviewmobj != NULL && !P_MobjWasRemoved(players[displayplayer].awayviewmobj))
viewingangle = R_PointToAngle2(mo->target->x, mo->target->y, players[displayplayer].awayviewmobj->x, players[displayplayer].awayviewmobj->y);
else if (!camera.chase && players[displayplayer].mo)
viewingangle = R_PointToAngle2(mo->target->x, mo->target->y, players[displayplayer].mo->x, players[displayplayer].mo->y);

View file

@ -8741,14 +8741,8 @@ void P_PlayerThink(player_t *player)
if (player->flashcount)
player->flashcount--;
// Re-fixed by Jimita (11-12-2018)
if (player->awayviewtics)
{
if (player->awayviewtics && player->awayviewtics != -1)
player->awayviewtics--;
if (!player->awayviewtics)
player->awayviewtics = -1;
// The timer might've reached zero, but we'll run the remote view camera anyway by setting it to -1.
}
/// \note do this in the cheat code
if (player->pflags & PF_NOCLIP)
@ -9526,9 +9520,6 @@ void P_PlayerAfterThink(player_t *player)
}
}
if (player->awayviewtics < 0)
player->awayviewtics = 0;
// spectator invisibility and nogravity.
if ((netgame || multiplayer) && player->spectator)
{