From 09a6c618985c0dec5073a42629d96e6bbaf5bfb7 Mon Sep 17 00:00:00 2001 From: Juice Date: Tue, 28 Dec 2021 03:07:43 +0300 Subject: [PATCH] Reset `m_flNextFollowTime` before trying to find next target after previous target death (#712) * Freelook bug fix * Update regamedll/dlls/player.cpp Co-authored-by: Sergey Shorokhov --- regamedll/dlls/player.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index c4854505..ac14a7ec 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -2102,6 +2102,11 @@ void EXT_FUNC CBasePlayer::__API_HOOK(Killed)(entvars_t *pevAttacker, int iGib) pObserver->m_bNightVisionOn = false; } + +#ifdef REGAMEDLL_FIXES + if (pObserver->m_hObserverTarget == this) + pObserver->m_flNextFollowTime = 0.0f; +#endif } if (m_pTank)