diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index b0a8ebdb7..17c2f9b22 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -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. @@ -3739,10 +3744,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);