Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix buy bots sec ammo #1034

Merged
merged 1 commit into from
Mar 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions regamedll/dlls/bot/states/cs_bot_buy.cpp
Original file line number Diff line number Diff line change
@@ -462,17 +462,26 @@ void BuyState::OnUpdate(CCSBot *me)
me->ClientCommand("vesthelm");
me->ClientCommand("vest");

// pistols - if we have no preferred pistol, buy at random
if (TheCSBots()->AllowPistols() && !me->GetProfile()->HasPistolPreference())
if (TheCSBots()->AllowPistols()
#ifndef REGAMEDLL_FIXES
&& !me->GetProfile()->HasPistolPreference()
#endif
)
{
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)
me->ClientCommand(secondaryWeaponBuyInfoT[which].buyAlias);
else
me->ClientCommand(secondaryWeaponBuyInfoCT[which].buyAlias);
if (me->m_iTeam == TERRORIST)
me->ClientCommand(secondaryWeaponBuyInfoT[which].buyAlias);
else
me->ClientCommand(secondaryWeaponBuyInfoCT[which].buyAlias);
}

// only buy one pistol
m_buyPistol = false;
Loading