From b36033626c40c13039957ff9b85c7d29edd92618 Mon Sep 17 00:00:00 2001 From: whipowill Date: Fri, 20 May 2022 12:55:44 -0500 Subject: [PATCH] Compile bug fixes. --- src/PlaceholderHelper.cpp | 2 +- src/PlayerbotAI.cpp | 4 +-- src/PlayerbotAIConfig.cpp | 74 +++++++++++++++++++-------------------- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/PlaceholderHelper.cpp b/src/PlaceholderHelper.cpp index c51a4303..6e4729cf 100644 --- a/src/PlaceholderHelper.cpp +++ b/src/PlaceholderHelper.cpp @@ -74,7 +74,7 @@ void PlaceholderHelper::InsertDungeonStrategy(Insertion& insertion) } } -void PlaceholderHelper::InsertDifficulty(Insertion& insertion, Player* bot) +void PlaceholderHelper::InsertDifficulty(Insertion& insertion, [[maybe_unused]] Player* bot) { bool const hasHeroic = insertion.dungeonSuggestion->difficulty == DUNGEON_DIFFICULTY_HEROIC; std::string difficultyText; diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index a4148eb1..37c2ba6e 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -999,7 +999,7 @@ void PlayerbotAI::DoNextAction(bool min) bot->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_PENDING_STOP); // set jump destination - bot->m_movementInfo.pos = !GetJumpDestination().m_positionZ == 0 ? GetJumpDestination() : bot->GetPosition(); + bot->m_movementInfo.pos = GetJumpDestination().m_positionZ != 0 ? GetJumpDestination() : bot->GetPosition(); bot->m_movementInfo.jump = MovementInfo::JumpInfo(); WorldPacket land(MSG_MOVE_FALL_LAND); @@ -3038,7 +3038,7 @@ std::string const PlayerbotAI::HandleRemoteCommand(std::string const command) out << " v: " << target->getDestination()->getVisitors(); - if (!(*target->getPosition() == WorldPosition())) + if (*target->getPosition() != WorldPosition()) { out << "(" << target->getPosition()->getAreaName() << ")"; out << " distance: " << target->getPosition()->distance(bot) << "y"; diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index 590ce58b..52bebcc8 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -45,7 +45,7 @@ bool PlayerbotAIConfig::Initialize() { LOG_INFO("server.loading", "Initializing AI Playerbots by ike3, based on the original Playerbots by blueboy"); - enabled = sConfigMgr->GetBoolDefault("AiPlayerbot.Enabled", true); + enabled = sConfigMgr->GetOption("AiPlayerbot.Enabled", true); if (!enabled) { LOG_INFO("server.loading", "AI Playerbots is Disabled in aiplayerbot.conf"); @@ -96,7 +96,7 @@ bool PlayerbotAIConfig::Initialize() iterationsPerTick = sConfigMgr->GetIntDefault("AiPlayerbot.IterationsPerTick", 100); - allowGuildBots = sConfigMgr->GetBoolDefault("AiPlayerbot.AllowGuildBots", true); + allowGuildBots = sConfigMgr->GetOption("AiPlayerbot.AllowGuildBots", true); randomBotMapsAsString = sConfigMgr->GetStringDefault("AiPlayerbot.RandomBotMaps", "0,1,530,571"); LoadList>(randomBotMapsAsString, randomBotMaps); @@ -105,8 +105,8 @@ bool PlayerbotAIConfig::Initialize() LoadList>(sConfigMgr->GetStringDefault("AiPlayerbot.PvpProhibitedZoneIds", "2255,656,2361,2362,2363,976,35,2268,3425,392,541,1446,3828,3712,3738,3565,3539,3623,4152,3988,4658,4284,4418,4436,4275,4323"), pvpProhibitedZoneIds); LoadList>(sConfigMgr->GetStringDefault("AiPlayerbot.RandomBotQuestIds", "7848,3802,5505,6502,7761"), randomBotQuestIds); - botAutologin = sConfigMgr->GetBoolDefault("AiPlayerbot.BotAutologin", false); - randomBotAutologin = sConfigMgr->GetBoolDefault("AiPlayerbot.RandomBotAutologin", true); + botAutologin = sConfigMgr->GetOption("AiPlayerbot.BotAutologin", false); + randomBotAutologin = sConfigMgr->GetOption("AiPlayerbot.RandomBotAutologin", true); minRandomBots = sConfigMgr->GetIntDefault("AiPlayerbot.MinRandomBots", 50); maxRandomBots = sConfigMgr->GetIntDefault("AiPlayerbot.MaxRandomBots", 200); randomBotUpdateInterval = sConfigMgr->GetIntDefault("AiPlayerbot.RandomBotUpdateInterval", MINUTE); @@ -124,17 +124,17 @@ bool PlayerbotAIConfig::Initialize() randomBotsPerInterval = sConfigMgr->GetIntDefault("AiPlayerbot.RandomBotsPerInterval", MINUTE); minRandomBotsPriceChangeInterval = sConfigMgr->GetIntDefault("AiPlayerbot.MinRandomBotsPriceChangeInterval", 2 * HOUR); maxRandomBotsPriceChangeInterval = sConfigMgr->GetIntDefault("AiPlayerbot.MaxRandomBotsPriceChangeInterval", 48 * HOUR); - randomBotJoinLfg = sConfigMgr->GetBoolDefault("AiPlayerbot.RandomBotJoinLfg", true); - randomBotSuggestDungeons = sConfigMgr->GetBoolDefault("AiPlayerbot.RandomBotSuggestDungeons", true); - suggestDungeonsInLowerCaseRandomly = sConfigMgr->GetBoolDefault("AiPlayerbot.SuggestDungeonsInLowerCaseRandomly", false); - randomBotJoinBG = sConfigMgr->GetBoolDefault("AiPlayerbot.RandomBotJoinBG", true); - logInGroupOnly = sConfigMgr->GetBoolDefault("AiPlayerbot.LogInGroupOnly", true); - logValuesPerTick = sConfigMgr->GetBoolDefault("AiPlayerbot.LogValuesPerTick", false); - fleeingEnabled = sConfigMgr->GetBoolDefault("AiPlayerbot.FleeingEnabled", true); - summonAtInnkeepersEnabled = sConfigMgr->GetBoolDefault("AiPlayerbot.SummonAtInnkeepersEnabled", true); + randomBotJoinLfg = sConfigMgr->GetOption("AiPlayerbot.RandomBotJoinLfg", true); + randomBotSuggestDungeons = sConfigMgr->GetOption("AiPlayerbot.RandomBotSuggestDungeons", true); + suggestDungeonsInLowerCaseRandomly = sConfigMgr->GetOption("AiPlayerbot.SuggestDungeonsInLowerCaseRandomly", false); + randomBotJoinBG = sConfigMgr->GetOption("AiPlayerbot.RandomBotJoinBG", true); + logInGroupOnly = sConfigMgr->GetOption("AiPlayerbot.LogInGroupOnly", true); + logValuesPerTick = sConfigMgr->GetOption("AiPlayerbot.LogValuesPerTick", false); + fleeingEnabled = sConfigMgr->GetOption("AiPlayerbot.FleeingEnabled", true); + summonAtInnkeepersEnabled = sConfigMgr->GetOption("AiPlayerbot.SummonAtInnkeepersEnabled", true); randomBotMinLevel = sConfigMgr->GetIntDefault("AiPlayerbot.RandomBotMinLevel", 1); randomBotMaxLevel = sConfigMgr->GetIntDefault("AiPlayerbot.RandomBotMaxLevel", 80); - randomBotLoginAtStartup = sConfigMgr->GetBoolDefault("AiPlayerbot.RandomBotLoginAtStartup", true); + randomBotLoginAtStartup = sConfigMgr->GetOption("AiPlayerbot.RandomBotLoginAtStartup", true); randomBotTeleLevel = sConfigMgr->GetIntDefault("AiPlayerbot.RandomBotTeleLevel", 5); openGoSpell = sConfigMgr->GetIntDefault("AiPlayerbot.OpenGoSpell", 6477); @@ -149,7 +149,7 @@ bool PlayerbotAIConfig::Initialize() commandSeparator = sConfigMgr->GetStringDefault("AiPlayerbot.CommandSeparator", "\\\\"); commandServerPort = sConfigMgr->GetIntDefault("AiPlayerbot.CommandServerPort", 8888); - perfMonEnabled = sConfigMgr->GetBoolDefault("AiPlayerbot.PerfMonEnabled", false); + perfMonEnabled = sConfigMgr->GetOption("AiPlayerbot.PerfMonEnabled", false); LOG_INFO("server.loading", "---------------------------------------"); LOG_INFO("server.loading", " Loading TalentSpecs "); @@ -251,11 +251,11 @@ bool PlayerbotAIConfig::Initialize() randomBotAccountPrefix = sConfigMgr->GetStringDefault("AiPlayerbot.RandomBotAccountPrefix", "rndbot"); randomBotAccountCount = sConfigMgr->GetIntDefault("AiPlayerbot.RandomBotAccountCount", 200); - deleteRandomBotAccounts = sConfigMgr->GetBoolDefault("AiPlayerbot.DeleteRandomBotAccounts", false); + deleteRandomBotAccounts = sConfigMgr->GetOption("AiPlayerbot.DeleteRandomBotAccounts", false); randomBotGuildCount = sConfigMgr->GetIntDefault("AiPlayerbot.RandomBotGuildCount", 20); - deleteRandomBotGuilds = sConfigMgr->GetBoolDefault("AiPlayerbot.DeleteRandomBotGuilds", false); + deleteRandomBotGuilds = sConfigMgr->GetOption("AiPlayerbot.DeleteRandomBotGuilds", false); - guildTaskEnabled = sConfigMgr->GetBoolDefault("AiPlayerbot.EnableGuildTasks", true); + guildTaskEnabled = sConfigMgr->GetOption("AiPlayerbot.EnableGuildTasks", true); minGuildTaskChangeTime = sConfigMgr->GetIntDefault("AiPlayerbot.MinGuildTaskChangeTime", 3 * 24 * 3600); maxGuildTaskChangeTime = sConfigMgr->GetIntDefault("AiPlayerbot.MaxGuildTaskChangeTime", 4 * 24 * 3600); minGuildTaskAdvertisementTime = sConfigMgr->GetIntDefault("AiPlayerbot.MinGuildTaskAdvertisementTime", 300); @@ -267,40 +267,40 @@ bool PlayerbotAIConfig::Initialize() targetPosRecalcDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.TargetPosRecalcDistance", 0.1f); // cosmetics (by lidocain) - randomBotShowCloak = sConfigMgr->GetBoolDefault("AiPlayerbot.RandomBotShowCloak", true); - randomBotShowHelmet = sConfigMgr->GetBoolDefault("AiPlayerbot.RandomBotShowHelmet", true); + randomBotShowCloak = sConfigMgr->GetOption("AiPlayerbot.RandomBotShowCloak", true); + randomBotShowHelmet = sConfigMgr->GetOption("AiPlayerbot.RandomBotShowHelmet", true); // SPP switches - enableGreet = sConfigMgr->GetBoolDefault("AiPlayerbot.EnableGreet", true); - disableRandomLevels = sConfigMgr->GetBoolDefault("AiPlayerbot.DisableRandomLevels", false); - randomBotRandomPassword = sConfigMgr->GetBoolDefault("AiPlayerbot.RandomBotRandomPassword", true); + enableGreet = sConfigMgr->GetOption("AiPlayerbot.EnableGreet", true); + disableRandomLevels = sConfigMgr->GetOption("AiPlayerbot.DisableRandomLevels", false); + randomBotRandomPassword = sConfigMgr->GetOption("AiPlayerbot.RandomBotRandomPassword", true); playerbotsXPrate = sConfigMgr->GetIntDefault("AiPlayerbot.KillXPRate", 1); botActiveAlone = sConfigMgr->GetIntDefault("AiPlayerbot.BotActiveAlone", 10); - randombotsWalkingRPG = sConfigMgr->GetBoolDefault("AiPlayerbot.RandombotsWalkingRPG", false); - randombotsWalkingRPGInDoors = sConfigMgr->GetBoolDefault("AiPlayerbot.RandombotsWalkingRPG.InDoors", false); + randombotsWalkingRPG = sConfigMgr->GetOption("AiPlayerbot.RandombotsWalkingRPG", false); + randombotsWalkingRPGInDoors = sConfigMgr->GetOption("AiPlayerbot.RandombotsWalkingRPG.InDoors", false); minEnchantingBotLevel = sConfigMgr->GetIntDefault("AiPlayerbot.MinEnchantingBotLevel", 60); randombotStartingLevel = sConfigMgr->GetIntDefault("AiPlayerbot.RandombotStartingLevel", 5); - gearscorecheck = sConfigMgr->GetBoolDefault("AiPlayerbot.GearScoreCheck", false); - randomBotPreQuests = sConfigMgr->GetBoolDefault("AiPlayerbot.PreQuests", true); + gearscorecheck = sConfigMgr->GetOption("AiPlayerbot.GearScoreCheck", false); + randomBotPreQuests = sConfigMgr->GetOption("AiPlayerbot.PreQuests", true); // SPP automation autoPickReward = sConfigMgr->GetStringDefault("AiPlayerbot.AutoPickReward", "yes"); - autoEquipUpgradeLoot = sConfigMgr->GetBoolDefault("AiPlayerbot.AutoEquipUpgradeLoot", true); - syncQuestWithPlayer = sConfigMgr->GetBoolDefault("AiPlayerbot.SyncQuestWithPlayer", false); - syncQuestForPlayer = sConfigMgr->GetBoolDefault("AiPlayerbot.SyncQuestForPlayer", false); + autoEquipUpgradeLoot = sConfigMgr->GetOption("AiPlayerbot.AutoEquipUpgradeLoot", true); + syncQuestWithPlayer = sConfigMgr->GetOption("AiPlayerbot.SyncQuestWithPlayer", false); + syncQuestForPlayer = sConfigMgr->GetOption("AiPlayerbot.SyncQuestForPlayer", false); autoTrainSpells = sConfigMgr->GetStringDefault("AiPlayerbot.AutoTrainSpells", "yes"); autoPickTalents = sConfigMgr->GetStringDefault("AiPlayerbot.AutoPickTalents", "full"); - autoLearnTrainerSpells = sConfigMgr->GetBoolDefault("AiPlayerbot.AutoLearnTrainerSpells", false); - autoLearnQuestSpells = sConfigMgr->GetBoolDefault("AiPlayerbot.AutoLearnQuestSpells", false); - autoDoQuests = sConfigMgr->GetBoolDefault("AiPlayerbot.AutoDoQuests", false); - syncLevelWithPlayers = sConfigMgr->GetBoolDefault("AiPlayerbot.SyncLevelWithPlayers", false); - freeFood = sConfigMgr->GetBoolDefault("AiPlayerbot.FreeFood", true); - randomBotSayWithoutMaster = sConfigMgr->GetBoolDefault("AiPlayerbot.RandomBotSayWithoutMaster", false); - randomBotGroupNearby = sConfigMgr->GetBoolDefault("AiPlayerbot.RandomBotGroupNearby", true); + autoLearnTrainerSpells = sConfigMgr->GetOption("AiPlayerbot.AutoLearnTrainerSpells", false); + autoLearnQuestSpells = sConfigMgr->GetOption("AiPlayerbot.AutoLearnQuestSpells", false); + autoDoQuests = sConfigMgr->GetOption("AiPlayerbot.AutoDoQuests", false); + syncLevelWithPlayers = sConfigMgr->GetOption("AiPlayerbot.SyncLevelWithPlayers", false); + freeFood = sConfigMgr->GetOption("AiPlayerbot.FreeFood", true); + randomBotSayWithoutMaster = sConfigMgr->GetOption("AiPlayerbot.RandomBotSayWithoutMaster", false); + randomBotGroupNearby = sConfigMgr->GetOption("AiPlayerbot.RandomBotGroupNearby", true); // arena randomBotArenaTeamCount = sConfigMgr->GetIntDefault("AiPlayerbot.RandomBotArenaTeamCount", 20); - deleteRandomBotArenaTeams = sConfigMgr->GetBoolDefault("AiPlayerbot.DeleteRandomBotArenaTeams", false); + deleteRandomBotArenaTeams = sConfigMgr->GetOption("AiPlayerbot.DeleteRandomBotArenaTeams", false); selfBotLevel = sConfigMgr->GetIntDefault("AiPlayerbot.SelfBotLevel", 1);