Player reset zoom & speed. (#541)

* RemoveAllItems: reset (update) player speed.
* RemoveAllItems: reset player zoom.
* RemovePlayerItem: reset player zoom & speed
* CFuncTank->StartControl: fully reset zoom.
This commit is contained in:
Vaqtincha 2020-05-27 06:33:10 +05:00 committed by GitHub
parent 0dd9b97c37
commit 27c15c38f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View File

@ -245,7 +245,11 @@ BOOL CFuncTank::StartControl(CBasePlayer *pController)
#endif #endif
#ifdef REGAMEDLL_FIXES #ifdef REGAMEDLL_FIXES
m_pController->m_iFOV = DEFAULT_FOV; // if (m_pController->m_iFOV != DEFAULT_FOV)
{
m_pController->pev->fov = m_pController->m_iFOV = m_pController->m_iLastZoom = DEFAULT_FOV;
m_pController->m_bResumeZoom = false;
}
#endif #endif
} }

View File

@ -1596,6 +1596,14 @@ void CBasePlayer::RemoveAllItems(BOOL removeSuit)
pev->viewmodel = 0; pev->viewmodel = 0;
pev->weaponmodel = 0; pev->weaponmodel = 0;
#ifdef REGAMEDLL_FIXES
// if (m_iFOV != DEFAULT_FOV)
{
pev->fov = m_iFOV = m_iLastZoom = DEFAULT_FOV;
m_bResumeZoom = false;
}
#endif
if (removeSuit) if (removeSuit)
pev->weapons = 0; pev->weapons = 0;
else else
@ -1611,6 +1619,8 @@ void CBasePlayer::RemoveAllItems(BOOL removeSuit)
m_bHasNightVision = false; m_bHasNightVision = false;
SendItemStatus(); SendItemStatus();
ResetMaxSpeed();
#endif #endif
// send Selected Weapon Message to our client // send Selected Weapon Message to our client
@ -6669,6 +6679,17 @@ BOOL EXT_FUNC CBasePlayer::__API_HOOK(RemovePlayerItem)(CBasePlayerItem *pItem)
if (m_pActiveItem == pItem) if (m_pActiveItem == pItem)
{ {
ResetAutoaim(); ResetAutoaim();
#ifdef REGAMEDLL_FIXES
// if (m_iFOV != DEFAULT_FOV)
{
pev->fov = m_iFOV = m_iLastZoom = DEFAULT_FOV;
m_bResumeZoom = false;
ResetMaxSpeed();
}
#endif
pItem->pev->nextthink = 0; pItem->pev->nextthink = 0;
pItem->SetThink(nullptr); pItem->SetThink(nullptr);