mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-14 15:48:01 +03:00
Bots can switch weapons underwater (#631)
* Bots can switch weapons underwater
This commit is contained in:
parent
d80d87366a
commit
3ff0f0cbf9
@ -516,6 +516,14 @@ void CCSBot::Update()
|
|||||||
m_isWaitingToTossGrenade = false;
|
m_isWaitingToTossGrenade = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
// bots with low skill cannot switch weapons underwater
|
||||||
|
if (GetProfile()->GetSkill() > 0.4f && pev->waterlevel == 3 && !IsActiveWeaponCanShootUnderwater())
|
||||||
|
{
|
||||||
|
EquipBestWeapon(MUST_EQUIP);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (IsHunting() && IsWellPastSafe() && IsUsingGrenade())
|
if (IsHunting() && IsWellPastSafe() && IsUsingGrenade())
|
||||||
{
|
{
|
||||||
EquipBestWeapon(MUST_EQUIP);
|
EquipBestWeapon(MUST_EQUIP);
|
||||||
|
@ -414,6 +414,11 @@ bool CCSBot::DoEquip(CBasePlayerWeapon *pWeapon)
|
|||||||
if (!pWeapon)
|
if (!pWeapon)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
if (GetProfile()->GetSkill() > 0.4f && pev->waterlevel == 3 && (pWeapon->iFlags() & ITEM_FLAG_NOFIREUNDERWATER))
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
// check if weapon has any ammo left
|
// check if weapon has any ammo left
|
||||||
if (!HasAnyAmmo(pWeapon))
|
if (!HasAnyAmmo(pWeapon))
|
||||||
return false;
|
return false;
|
||||||
|
@ -196,6 +196,8 @@ public:
|
|||||||
// is the weapon in the middle of a reload
|
// is the weapon in the middle of a reload
|
||||||
bool IsActiveWeaponReloading() const;
|
bool IsActiveWeaponReloading() const;
|
||||||
|
|
||||||
|
bool IsActiveWeaponCanShootUnderwater() const;
|
||||||
|
|
||||||
// return true if active weapon's bullet spray has become large and inaccurate
|
// return true if active weapon's bullet spray has become large and inaccurate
|
||||||
bool IsActiveWeaponRecoilHigh() const;
|
bool IsActiveWeaponRecoilHigh() const;
|
||||||
|
|
||||||
@ -327,6 +329,15 @@ inline CBasePlayerWeapon *CBot::GetActiveWeapon() const
|
|||||||
return static_cast<CBasePlayerWeapon *>(m_pActiveItem);
|
return static_cast<CBasePlayerWeapon *>(m_pActiveItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool CBot::IsActiveWeaponCanShootUnderwater() const
|
||||||
|
{
|
||||||
|
CBasePlayerWeapon *pCurrentWeapon = GetActiveWeapon();
|
||||||
|
if (pCurrentWeapon && !(pCurrentWeapon->iFlags() & ITEM_FLAG_NOFIREUNDERWATER))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool CBot::IsActiveWeaponReloading() const
|
inline bool CBot::IsActiveWeaponReloading() const
|
||||||
{
|
{
|
||||||
CBasePlayerWeapon *pCurrentWeapon = GetActiveWeapon();
|
CBasePlayerWeapon *pCurrentWeapon = GetActiveWeapon();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user