From c68875ad938bc7b8b44607361392360b43066f74 Mon Sep 17 00:00:00 2001 From: MPC Date: Tue, 11 Dec 2018 20:27:26 -0300 Subject: [PATCH 1/2] Fix remote viewpoint cameras for real I'm so sorry --- src/p_user.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index cf1296694..af3f7ebf8 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8712,9 +8712,15 @@ void P_PlayerThink(player_t *player) if (player->flashcount) player->flashcount--; - // By the time P_MoveChaseCamera is called, this might be zero. Do not do it here. - //if (player->awayviewtics) - // player->awayviewtics--; + // Re-fixed by Jimita (11-12-2018) + if (player->awayviewtics) + { + player->awayviewtics--; + if (!player->awayviewtics) + player->awayviewtics = -1; + // The timer might've reached zero, but we'll run the remote view camera anyway. + // This is completely fine to do, since -1 evaluates to true in a "if (!player->awayviewtics)" conditional. + } /// \note do this in the cheat code if (player->pflags & PF_NOCLIP) @@ -9492,8 +9498,9 @@ void P_PlayerAfterThink(player_t *player) } } - if (player->awayviewtics) - player->awayviewtics--; + // Reset it to zero if it's a -1. + if (player->awayviewtics < 0) + player->awayviewtics = 0; // spectator invisibility and nogravity. if ((netgame || multiplayer) && player->spectator) From 966afb60171cae5351f35262eb35fb6a1e1bfdee Mon Sep 17 00:00:00 2001 From: Jimita <16945067+monster-psychic-cat@users.noreply.github.com> Date: Wed, 12 Dec 2018 13:09:47 -0200 Subject: [PATCH 2/2] Update p_user.c --- src/p_user.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index af3f7ebf8..ecb664ad4 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8718,8 +8718,7 @@ void P_PlayerThink(player_t *player) player->awayviewtics--; if (!player->awayviewtics) player->awayviewtics = -1; - // The timer might've reached zero, but we'll run the remote view camera anyway. - // This is completely fine to do, since -1 evaluates to true in a "if (!player->awayviewtics)" conditional. + // 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 @@ -9498,7 +9497,6 @@ void P_PlayerAfterThink(player_t *player) } } - // Reset it to zero if it's a -1. if (player->awayviewtics < 0) player->awayviewtics = 0;