fix: do not prevent buying on fy_* maps, (fix #325)

If you need to prevent bots buying on specific map use map-cfg with yb_botbuy 0.
This commit is contained in:
dmitry 2022-04-03 14:43:29 +03:00
commit 06774a4282
No known key found for this signature in database
GPG key ID: 8297CE728B7A7E37
4 changed files with 4 additions and 4 deletions

View file

@ -54,7 +54,7 @@ CR_DECLARE_SCOPED_ENUM (MapFlags,
Demolition = cr::bit (2), Demolition = cr::bit (2),
Escape = cr::bit (3), Escape = cr::bit (3),
KnifeArena = cr::bit (4), KnifeArena = cr::bit (4),
Fun = cr::bit (5), FightYard = cr::bit (5),
HasDoors = cr::bit (10), // additional flags HasDoors = cr::bit (10), // additional flags
HasButtons = cr::bit (11) // map has buttons HasButtons = cr::bit (11) // map has buttons
) )

View file

@ -1108,7 +1108,7 @@ void Bot::checkMsgQueue () {
} }
// prevent teams from buying on fun maps // prevent teams from buying on fun maps
if (game.mapIs (MapFlags::KnifeArena | MapFlags::Fun)) { if (game.mapIs (MapFlags::KnifeArena)) {
m_buyState = BuyState::Done; m_buyState = BuyState::Done;
if (game.mapIs (MapFlags::KnifeArena)) { if (game.mapIs (MapFlags::KnifeArena)) {

View file

@ -153,7 +153,7 @@ void Game::levelInitialize (edict_t *entities, int max) {
// next maps doesn't have map-specific entities, so determine it by name // next maps doesn't have map-specific entities, so determine it by name
if (strncmp (getMapName (), "fy_", 3) == 0) { if (strncmp (getMapName (), "fy_", 3) == 0) {
m_mapFlags |= MapFlags::Fun; m_mapFlags |= MapFlags::FightYard;
} }
else if (strncmp (getMapName (), "ka_", 3) == 0) { else if (strncmp (getMapName (), "ka_", 3) == 0) {
m_mapFlags |= MapFlags::KnifeArena; m_mapFlags |= MapFlags::KnifeArena;

View file

@ -1785,7 +1785,7 @@ void BotManager::selectLeaders (int team, bool reset) {
m_leaderChoosen[Team::CT] = true; m_leaderChoosen[Team::CT] = true;
} }
} }
else if (game.mapIs (MapFlags::Escape | MapFlags::KnifeArena | MapFlags::Fun)) { else if (game.mapIs (MapFlags::Escape | MapFlags::KnifeArena | MapFlags::FightYard)) {
auto bot = bots.findHighestFragBot (team); auto bot = bots.findHighestFragBot (team);
if (!m_leaderChoosen[team] && bot) { if (!m_leaderChoosen[team] && bot) {