mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-06-20 01:32:06 +03:00
Enhanced bot_quota_mode
This commit is contained in:
parent
0aa974cd63
commit
3442cb3bf3
@ -829,15 +829,38 @@ void CCSBotManager::MaintainBotQuota()
|
|||||||
int desiredBotCount = int(cv_bot_quota.value);
|
int desiredBotCount = int(cv_bot_quota.value);
|
||||||
int occupiedBotSlots = UTIL_BotsInGame();
|
int occupiedBotSlots = UTIL_BotsInGame();
|
||||||
|
|
||||||
|
// isRoundInProgress is true if the round has progressed far enough that new players will join as dead.
|
||||||
|
bool isRoundInProgress = CSGameRules()->IsGameStarted() &&
|
||||||
|
!TheCSBots()->IsRoundOver() &&
|
||||||
|
(CSGameRules()->GetRoundElapsedTime() >= CSGameRules()->GetRoundRespawnTime());
|
||||||
|
|
||||||
#ifdef REGAMEDLL_ADD
|
#ifdef REGAMEDLL_ADD
|
||||||
if (FStrEq(cv_bot_quota_mode.string, "fill"))
|
if (FStrEq(cv_bot_quota_mode.string, "fill"))
|
||||||
|
{
|
||||||
|
// If bot_quota_mode is 'fill', we want the number of bots and humans together to equal bot_quota
|
||||||
|
// unless the round is already in progress, in which case we play with what we've been dealt
|
||||||
|
if (!isRoundInProgress)
|
||||||
{
|
{
|
||||||
desiredBotCount = Q_max(0, desiredBotCount - humanPlayersInGame);
|
desiredBotCount = Q_max(0, desiredBotCount - humanPlayersInGame);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
desiredBotCount = occupiedBotSlots;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (FStrEq(cv_bot_quota_mode.string, "match"))
|
else if (FStrEq(cv_bot_quota_mode.string, "match"))
|
||||||
|
{
|
||||||
|
// If bot_quota_mode is 'match', we want the number of bots to be bot_quota * total humans
|
||||||
|
// unless the round is already in progress, in which case we play with what we've been dealt
|
||||||
|
if (!isRoundInProgress)
|
||||||
{
|
{
|
||||||
desiredBotCount = Q_max<int>(0, cv_bot_quota.value * humanPlayersInGame);
|
desiredBotCount = Q_max<int>(0, cv_bot_quota.value * humanPlayersInGame);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
desiredBotCount = occupiedBotSlots;
|
||||||
|
}
|
||||||
|
}
|
||||||
#else // #ifdef REGAMEDLL_ADD
|
#else // #ifdef REGAMEDLL_ADD
|
||||||
if (cv_bot_quota_match.value > 0.0)
|
if (cv_bot_quota_match.value > 0.0)
|
||||||
{
|
{
|
||||||
|
@ -634,6 +634,7 @@ public:
|
|||||||
float GetRoundRemainingTime() const { return m_iRoundTimeSecs - gpGlobals->time + m_fRoundStartTime; }
|
float GetRoundRemainingTime() const { return m_iRoundTimeSecs - gpGlobals->time + m_fRoundStartTime; }
|
||||||
float GetRoundRemainingTimeReal() const;
|
float GetRoundRemainingTimeReal() const;
|
||||||
float GetTimeLeft() const { return m_flTimeLimit - gpGlobals->time; }
|
float GetTimeLeft() const { return m_flTimeLimit - gpGlobals->time; }
|
||||||
|
float GetRoundElapsedTime() const { return gpGlobals->time - m_fRoundStartTime; }
|
||||||
|
|
||||||
BOOL TeamFull(int team_id);
|
BOOL TeamFull(int team_id);
|
||||||
BOOL TeamStacked(int newTeam_id, int curTeam_id);
|
BOOL TeamStacked(int newTeam_id, int curTeam_id);
|
||||||
@ -668,6 +669,8 @@ public:
|
|||||||
float GetRoundRespawnTime() const;
|
float GetRoundRespawnTime() const;
|
||||||
float GetRoundRestartDelay() const;
|
float GetRoundRestartDelay() const;
|
||||||
|
|
||||||
|
bool IsGameStarted() const { return m_bGameStarted; }
|
||||||
|
|
||||||
// has a style of gameplay when aren't any teams
|
// has a style of gameplay when aren't any teams
|
||||||
bool IsFreeForAll() const;
|
bool IsFreeForAll() const;
|
||||||
bool CanPlayerBuy(CBasePlayer *pPlayer) const;
|
bool CanPlayerBuy(CBasePlayer *pPlayer) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user