mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-03-04 01:35:23 +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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pPlayer->m_iAutoWepSwitch)
|
if (pPlayer->m_iAutoWepSwitch == 0)
|
||||||
return FALSE;
|
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())
|
if (!pPlayer->m_pActiveItem->CanHolster())
|
||||||
{
|
{
|
||||||
// can't put away the active item.
|
// can't put away the active item.
|
||||||
@ -3742,10 +3747,19 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(PlayerSpawn)(CBasePlayer *pPlayer)
|
|||||||
if (pPlayer->m_bJustConnected)
|
if (pPlayer->m_bJustConnected)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_ADD
|
||||||
|
int iAutoWepSwitch = pPlayer->m_iAutoWepSwitch;
|
||||||
|
pPlayer->m_iAutoWepSwitch = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
pPlayer->pev->weapons |= (1 << WEAPON_SUIT);
|
pPlayer->pev->weapons |= (1 << WEAPON_SUIT);
|
||||||
pPlayer->OnSpawnEquip();
|
pPlayer->OnSpawnEquip();
|
||||||
pPlayer->SetPlayerModel(false);
|
pPlayer->SetPlayerModel(false);
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_ADD
|
||||||
|
pPlayer->m_iAutoWepSwitch = iAutoWepSwitch;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef REGAMEDLL_ADD
|
#ifdef REGAMEDLL_ADD
|
||||||
if (respawn_immunitytime.value > 0)
|
if (respawn_immunitytime.value > 0)
|
||||||
pPlayer->SetSpawnProtection(respawn_immunitytime.value);
|
pPlayer->SetSpawnProtection(respawn_immunitytime.value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user