mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-04-09 19:20:03 +03:00
fix: bots can't buy sec ammo if preferred pistol (ex. "WeaponPreference = deagle" in BotProfile.db) (#1034)
This commit is contained in:
parent
6adb795fee
commit
b8e9726347
@ -462,17 +462,26 @@ void BuyState::OnUpdate(CCSBot *me)
|
|||||||
me->ClientCommand("vesthelm");
|
me->ClientCommand("vesthelm");
|
||||||
me->ClientCommand("vest");
|
me->ClientCommand("vest");
|
||||||
|
|
||||||
// pistols - if we have no preferred pistol, buy at random
|
if (TheCSBots()->AllowPistols()
|
||||||
if (TheCSBots()->AllowPistols() && !me->GetProfile()->HasPistolPreference())
|
#ifndef REGAMEDLL_FIXES
|
||||||
|
&& !me->GetProfile()->HasPistolPreference()
|
||||||
|
#endif
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if (m_buyPistol)
|
if (m_buyPistol)
|
||||||
{
|
{
|
||||||
int which = RANDOM_LONG(0, MAX_BUY_WEAPON_SECONDARY - 1);
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
// pistols - if we have no preferred pistol, buy at random
|
||||||
|
if (!me->GetProfile()->HasPistolPreference())
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
int which = RANDOM_LONG(0, MAX_BUY_WEAPON_SECONDARY - 1);
|
||||||
|
|
||||||
if (me->m_iTeam == TERRORIST)
|
if (me->m_iTeam == TERRORIST)
|
||||||
me->ClientCommand(secondaryWeaponBuyInfoT[which].buyAlias);
|
me->ClientCommand(secondaryWeaponBuyInfoT[which].buyAlias);
|
||||||
else
|
else
|
||||||
me->ClientCommand(secondaryWeaponBuyInfoCT[which].buyAlias);
|
me->ClientCommand(secondaryWeaponBuyInfoCT[which].buyAlias);
|
||||||
|
}
|
||||||
|
|
||||||
// only buy one pistol
|
// only buy one pistol
|
||||||
m_buyPistol = false;
|
m_buyPistol = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user