mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-03-03 17:25:24 +03:00
Add newest feature of _cl_autowepswitch (#568)
This commit is contained in:
parent
c56982af18
commit
9b10456590
@ -3212,9 +3212,14 @@ BOOL EXT_FUNC CHalfLifeMultiplay::__API_HOOK(FShouldSwitchWeapon)(CBasePlayer *p
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (!pPlayer->m_iAutoWepSwitch)
|
||||
if (pPlayer->m_iAutoWepSwitch == 0)
|
||||
return FALSE;
|
||||
|
||||
#ifdef REGAMEDLL_ADD
|
||||
if (pPlayer->m_iAutoWepSwitch == 2 && (pPlayer->m_afButtonLast & (IN_ATTACK | IN_ATTACK2)))
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
if (!pPlayer->m_pActiveItem->CanHolster())
|
||||
{
|
||||
// can't put away the active item.
|
||||
@ -3742,10 +3747,19 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(PlayerSpawn)(CBasePlayer *pPlayer)
|
||||
if (pPlayer->m_bJustConnected)
|
||||
return;
|
||||
|
||||
#ifdef REGAMEDLL_ADD
|
||||
int iAutoWepSwitch = pPlayer->m_iAutoWepSwitch;
|
||||
pPlayer->m_iAutoWepSwitch = 1;
|
||||
#endif
|
||||
|
||||
pPlayer->pev->weapons |= (1 << WEAPON_SUIT);
|
||||
pPlayer->OnSpawnEquip();
|
||||
pPlayer->SetPlayerModel(false);
|
||||
|
||||
#ifdef REGAMEDLL_ADD
|
||||
pPlayer->m_iAutoWepSwitch = iAutoWepSwitch;
|
||||
#endif
|
||||
|
||||
#ifdef REGAMEDLL_ADD
|
||||
if (respawn_immunitytime.value > 0)
|
||||
pPlayer->SetSpawnProtection(respawn_immunitytime.value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user