improved sniping

fixed bots never choice camping tactic, due to agression level oveflow
cosmetic changes
This commit is contained in:
jeefo 2016-01-30 13:15:50 +03:00
commit 9e5c1540f9
13 changed files with 336 additions and 310 deletions

View file

@ -31,8 +31,8 @@ BotManager::BotManager (void)
m_lastWinner = -1;
m_deathMsgSent = false;
m_economicsGood[TEAM_TF] = true;
m_economicsGood[TEAM_CF] = true;
m_economicsGood[TERRORIST] = true;
m_economicsGood[CT] = true;
memset (m_bots, 0, sizeof (m_bots));
@ -341,9 +341,14 @@ void BotManager::AdjustQuota (bool isPlayerConnection, edict_t *ent)
AddPlayerToCheckTeamQueue (ent);
else
RemoveRandom ();
m_balanceCount--;
}
else
else if (m_balanceCount <= 0)
{
AddRandom ();
m_balanceCount++;
}
}
void BotManager::AddPlayerToCheckTeamQueue (edict_t *ent)
@ -373,7 +378,7 @@ void BotManager::VerifyPlayersHasJoinedTeam (int &desiredCount)
{
Client &cl = g_clients[i];
if ((cl.flags & CF_USED) && cl.team != TEAM_SPEC && !IsValidBot (cl.ent))
if ((cl.flags & CF_USED) && cl.team != SPECTATOR && !IsValidBot (cl.ent))
{
FOR_EACH_AE (m_trackedPlayers, it)
{
@ -458,6 +463,8 @@ void BotManager::MaintainBotQuota (void)
void BotManager::InitQuota (void)
{
m_balanceCount = 0;
m_maintainTime = GetWorldTime () + 3.0f;
m_quotaMaintainTime = GetWorldTime () + 3.0f;
@ -559,7 +566,7 @@ void BotManager::RemoveMenu (edict_t *ent, int selection)
if ((m_bots[i] != NULL) && !IsEntityNull (m_bots[i]->GetEntity ()))
{
validSlots |= 1 << (i - ((selection - 1) * 8));
sprintf (buffer, "%s %1.1d. %s%s\n", buffer, i - ((selection - 1) * 8) + 1, STRING (m_bots[i]->pev->netname), GetTeam (m_bots[i]->GetEntity ()) == TEAM_CF ? " \\y(CT)\\w" : " \\r(T)\\w");
sprintf (buffer, "%s %1.1d. %s%s\n", buffer, i - ((selection - 1) * 8) + 1, STRING (m_bots[i]->pev->netname), GetTeam (m_bots[i]->GetEntity ()) == CT ? " \\y(CT)\\w" : " \\r(T)\\w");
}
else
sprintf (buffer, "%s\\d %1.1d. Not a Bot\\w\n", buffer, i - ((selection - 1) * 8) + 1);
@ -1026,7 +1033,7 @@ int BotManager::GetHumansJoinedTeam (void)
{
Client *cl = &g_clients[i];
if ((cl->flags & (CF_USED | CF_ALIVE)) && m_bots[i] == NULL && cl->team != TEAM_SPEC && !(cl->ent->v.flags & FL_FAKECLIENT) && cl->ent->v.movetype != MOVETYPE_FLY)
if ((cl->flags & (CF_USED | CF_ALIVE)) && m_bots[i] == NULL && cl->team != SPECTATOR && !(cl->ent->v.flags & FL_FAKECLIENT) && cl->ent->v.movetype != MOVETYPE_FLY)
count++;
}
return count;