diff --git a/.gitignore b/.gitignore index 3317db68..ef5db6e0 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ CMakeLists.txt.user nbproject/ .sync.ffs_db *.kate-swp +reset.sh # # Eclipse diff --git a/src/FleeManager.h b/src/FleeManager.h index fe24eb8f..5ca801f0 100644 --- a/src/FleeManager.h +++ b/src/FleeManager.h @@ -46,7 +46,7 @@ class FleeManager Player* bot; float maxAllowedDistance; - float followAngle; + [[maybe_unused]] float followAngle; // unused - whipowill bool forceMaxDistance; WorldPosition startPosition; }; 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 1eb0e9b8..a4148eb1 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -79,7 +79,7 @@ PlayerbotAI::PlayerbotAI() : PlayerbotAIBase(true), bot(nullptr), aiObjectContex } } -PlayerbotAI::PlayerbotAI(Player* bot) : PlayerbotAIBase(true), bot(bot), chatHelper(this), chatFilter(this), security(bot), master(nullptr) +PlayerbotAI::PlayerbotAI(Player* bot) : PlayerbotAIBase(true), bot(bot), chatHelper(this), chatFilter(this), master(nullptr), security(bot) // reorder args - whipowill { if (!bot->isTaxiCheater() && HasCheat((BotCheatMask::taxi))) bot->SetTaxiCheater(true); @@ -253,7 +253,7 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal) YieldThread(min); } -void PlayerbotAI::UpdateAIInternal(uint32 elapsed, bool minimal) +void PlayerbotAI::UpdateAIInternal([[maybe_unused]] uint32 elapsed, bool minimal) { if (bot->IsBeingTeleported() || !bot->IsInWorld()) return; @@ -801,7 +801,7 @@ void PlayerbotAI::DoNextAction(bool min) bot->GetMotionMaster()->MoveIdle(); //Death Count to prevent skeleton piles - Player* master = GetMaster(); + Player* master = GetMaster(); // warning here - whipowill if (!HasActivePlayerMaster() && !bot->InBattleground()) { uint32 dCount = aiObjectContext->GetValue("death count")->Get(); diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index 590ce58b..e8a02a5c 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -45,111 +45,111 @@ 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"); return false; } - globalCoolDown = sConfigMgr->GetIntDefault("AiPlayerbot.GlobalCooldown", 1500); - maxWaitForMove = sConfigMgr->GetIntDefault("AiPlayerbot.MaxWaitForMove", 5000); - expireActionTime = sConfigMgr->GetIntDefault("AiPlayerbot.ExpireActionTime", 5000); - dispelAuraDuration = sConfigMgr->GetIntDefault("AiPlayerbot.DispelAuraDuration", 7000); - reactDelay = sConfigMgr->GetIntDefault("AiPlayerbot.ReactDelay", 500); - passiveDelay = sConfigMgr->GetIntDefault("AiPlayerbot.PassiveDelay", 10000); - repeatDelay = sConfigMgr->GetIntDefault("AiPlayerbot.RepeatDelay", 5000); - errorDelay = sConfigMgr->GetIntDefault("AiPlayerbot.ErrorDelay", 5000); - rpgDelay = sConfigMgr->GetIntDefault("AiPlayerbot.RpgDelay", 10000); - sitDelay = sConfigMgr->GetIntDefault("AiPlayerbot.SitDelay", 30000); - returnDelay = sConfigMgr->GetIntDefault("AiPlayerbot.ReturnDelay", 7000); - lootDelay = sConfigMgr->GetIntDefault("AiPlayerbot.LootDelay", 1000); + globalCoolDown = sConfigMgr->GetOption("AiPlayerbot.GlobalCooldown", 1500); + maxWaitForMove = sConfigMgr->GetOption("AiPlayerbot.MaxWaitForMove", 5000); + expireActionTime = sConfigMgr->GetOption("AiPlayerbot.ExpireActionTime", 5000); + dispelAuraDuration = sConfigMgr->GetOption("AiPlayerbot.DispelAuraDuration", 7000); + reactDelay = sConfigMgr->GetOption("AiPlayerbot.ReactDelay", 500); + passiveDelay = sConfigMgr->GetOption("AiPlayerbot.PassiveDelay", 10000); + repeatDelay = sConfigMgr->GetOption("AiPlayerbot.RepeatDelay", 5000); + errorDelay = sConfigMgr->GetOption("AiPlayerbot.ErrorDelay", 5000); + rpgDelay = sConfigMgr->GetOption("AiPlayerbot.RpgDelay", 10000); + sitDelay = sConfigMgr->GetOption("AiPlayerbot.SitDelay", 30000); + returnDelay = sConfigMgr->GetOption("AiPlayerbot.ReturnDelay", 7000); + lootDelay = sConfigMgr->GetOption("AiPlayerbot.LootDelay", 1000); - farDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.FarDistance", 20.0f); - sightDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.SightDistance", 75.0f); - spellDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.SpellDistance", 22.0f); - shootDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.ShootDistance", 25.0f); - healDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.HealDistance", 20.0f); - lootDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.LootDistance", 15.0f); - fleeDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.FleeDistance", 7.5f); - aggroDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.AggroDistance", 22.0f); - tooCloseDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.TooCloseDistance", 5.0f); - meleeDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.MeleeDistance", 1.5f); - followDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.FollowDistance", 1.5f); - whisperDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.WhisperDistance", 6000.0f); - contactDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.ContactDistance", 0.5f); - aoeRadius = sConfigMgr->GetFloatDefault("AiPlayerbot.AoeRadius", 5.0f); - rpgDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.RpgDistance", 200.0f); - grindDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.GrindDistance", 75.0f); - reactDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.ReactDistance", 150.0f); + farDistance = sConfigMgr->GetOption("AiPlayerbot.FarDistance", 20.0f); + sightDistance = sConfigMgr->GetOption("AiPlayerbot.SightDistance", 75.0f); + spellDistance = sConfigMgr->GetOption("AiPlayerbot.SpellDistance", 22.0f); + shootDistance = sConfigMgr->GetOption("AiPlayerbot.ShootDistance", 25.0f); + healDistance = sConfigMgr->GetOption("AiPlayerbot.HealDistance", 20.0f); + lootDistance = sConfigMgr->GetOption("AiPlayerbot.LootDistance", 15.0f); + fleeDistance = sConfigMgr->GetOption("AiPlayerbot.FleeDistance", 7.5f); + aggroDistance = sConfigMgr->GetOption("AiPlayerbot.AggroDistance", 22.0f); + tooCloseDistance = sConfigMgr->GetOption("AiPlayerbot.TooCloseDistance", 5.0f); + meleeDistance = sConfigMgr->GetOption("AiPlayerbot.MeleeDistance", 1.5f); + followDistance = sConfigMgr->GetOption("AiPlayerbot.FollowDistance", 1.5f); + whisperDistance = sConfigMgr->GetOption("AiPlayerbot.WhisperDistance", 6000.0f); + contactDistance = sConfigMgr->GetOption("AiPlayerbot.ContactDistance", 0.5f); + aoeRadius = sConfigMgr->GetOption("AiPlayerbot.AoeRadius", 5.0f); + rpgDistance = sConfigMgr->GetOption("AiPlayerbot.RpgDistance", 200.0f); + grindDistance = sConfigMgr->GetOption("AiPlayerbot.GrindDistance", 75.0f); + reactDistance = sConfigMgr->GetOption("AiPlayerbot.ReactDistance", 150.0f); - criticalHealth = sConfigMgr->GetIntDefault("AiPlayerbot.CriticalHealth", 20); - lowHealth = sConfigMgr->GetIntDefault("AiPlayerbot.LowHealth", 45); - mediumHealth = sConfigMgr->GetIntDefault("AiPlayerbot.MediumHealth", 65); - almostFullHealth = sConfigMgr->GetIntDefault("AiPlayerbot.AlmostFullHealth", 85); - lowMana = sConfigMgr->GetIntDefault("AiPlayerbot.LowMana", 15); - mediumMana = sConfigMgr->GetIntDefault("AiPlayerbot.MediumMana", 40); + criticalHealth = sConfigMgr->GetOption("AiPlayerbot.CriticalHealth", 20); + lowHealth = sConfigMgr->GetOption("AiPlayerbot.LowHealth", 45); + mediumHealth = sConfigMgr->GetOption("AiPlayerbot.MediumHealth", 65); + almostFullHealth = sConfigMgr->GetOption("AiPlayerbot.AlmostFullHealth", 85); + lowMana = sConfigMgr->GetOption("AiPlayerbot.LowMana", 15); + mediumMana = sConfigMgr->GetOption("AiPlayerbot.MediumMana", 40); - randomGearLoweringChance = sConfigMgr->GetFloatDefault("AiPlayerbot.RandomGearLoweringChance", 0.15f); - randomBotMaxLevelChance = sConfigMgr->GetFloatDefault("AiPlayerbot.RandomBotMaxLevelChance", 0.15f); - randomBotRpgChance = sConfigMgr->GetFloatDefault("AiPlayerbot.RandomBotRpgChance", 0.20f); + randomGearLoweringChance = sConfigMgr->GetOption("AiPlayerbot.RandomGearLoweringChance", 0.15f); + randomBotMaxLevelChance = sConfigMgr->GetOption("AiPlayerbot.RandomBotMaxLevelChance", 0.15f); + randomBotRpgChance = sConfigMgr->GetOption("AiPlayerbot.RandomBotRpgChance", 0.20f); - iterationsPerTick = sConfigMgr->GetIntDefault("AiPlayerbot.IterationsPerTick", 100); + iterationsPerTick = sConfigMgr->GetOption("AiPlayerbot.IterationsPerTick", 100); - allowGuildBots = sConfigMgr->GetBoolDefault("AiPlayerbot.AllowGuildBots", true); + allowGuildBots = sConfigMgr->GetOption("AiPlayerbot.AllowGuildBots", true); - randomBotMapsAsString = sConfigMgr->GetStringDefault("AiPlayerbot.RandomBotMaps", "0,1,530,571"); + randomBotMapsAsString = sConfigMgr->GetOption("AiPlayerbot.RandomBotMaps", "0,1,530,571"); LoadList>(randomBotMapsAsString, randomBotMaps); - LoadList>(sConfigMgr->GetStringDefault("AiPlayerbot.RandomBotQuestItems", "6948,5175,5176,5177,5178,16309,12382,13704,11000"), randomBotQuestItems); - LoadList>(sConfigMgr->GetStringDefault("AiPlayerbot.RandomBotSpellIds", "54197"), randomBotSpellIds); - 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); + LoadList>(sConfigMgr->GetOption("AiPlayerbot.RandomBotQuestItems", "6948,5175,5176,5177,5178,16309,12382,13704,11000"), randomBotQuestItems); + LoadList>(sConfigMgr->GetOption("AiPlayerbot.RandomBotSpellIds", "54197"), randomBotSpellIds); + LoadList>(sConfigMgr->GetOption("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->GetOption("AiPlayerbot.RandomBotQuestIds", "7848,3802,5505,6502,7761"), randomBotQuestIds); - botAutologin = sConfigMgr->GetBoolDefault("AiPlayerbot.BotAutologin", false); - randomBotAutologin = sConfigMgr->GetBoolDefault("AiPlayerbot.RandomBotAutologin", true); - minRandomBots = sConfigMgr->GetIntDefault("AiPlayerbot.MinRandomBots", 50); - maxRandomBots = sConfigMgr->GetIntDefault("AiPlayerbot.MaxRandomBots", 200); - randomBotUpdateInterval = sConfigMgr->GetIntDefault("AiPlayerbot.RandomBotUpdateInterval", MINUTE); - randomBotCountChangeMinInterval = sConfigMgr->GetIntDefault("AiPlayerbot.RandomBotCountChangeMinInterval", 30 * MINUTE); - randomBotCountChangeMaxInterval = sConfigMgr->GetIntDefault("AiPlayerbot.RandomBotCountChangeMaxInterval", 2 * HOUR); - minRandomBotInWorldTime = sConfigMgr->GetIntDefault("AiPlayerbot.MinRandomBotInWorldTime", 2 * HOUR); - maxRandomBotInWorldTime = sConfigMgr->GetIntDefault("AiPlayerbot.MaxRandomBotInWorldTime", 12 * HOUR); - minRandomBotRandomizeTime = sConfigMgr->GetIntDefault("AiPlayerbot.MinRandomBotRandomizeTime", 2 * HOUR); - maxRandomBotRandomizeTime = sConfigMgr->GetIntDefault("AiPlayerbot.MaxRandomRandomizeTime", 14 * 24 * HOUR); - minRandomBotChangeStrategyTime = sConfigMgr->GetIntDefault("AiPlayerbot.MinRandomBotChangeStrategyTime", 30 * MINUTE); - maxRandomBotChangeStrategyTime = sConfigMgr->GetIntDefault("AiPlayerbot.MaxRandomBotChangeStrategyTime", 2 * HOUR); - minRandomBotReviveTime = sConfigMgr->GetIntDefault("AiPlayerbot.MinRandomBotReviveTime", MINUTE); - maxRandomBotReviveTime = sConfigMgr->GetIntDefault("AiPlayerbot.MaxRandomBotReviveTime", 5 * MINUTE); - randomBotTeleportDistance = sConfigMgr->GetIntDefault("AiPlayerbot.RandomBotTeleportDistance", 100); - 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); - randomBotMinLevel = sConfigMgr->GetIntDefault("AiPlayerbot.RandomBotMinLevel", 1); - randomBotMaxLevel = sConfigMgr->GetIntDefault("AiPlayerbot.RandomBotMaxLevel", 80); - randomBotLoginAtStartup = sConfigMgr->GetBoolDefault("AiPlayerbot.RandomBotLoginAtStartup", true); - randomBotTeleLevel = sConfigMgr->GetIntDefault("AiPlayerbot.RandomBotTeleLevel", 5); - openGoSpell = sConfigMgr->GetIntDefault("AiPlayerbot.OpenGoSpell", 6477); + botAutologin = sConfigMgr->GetOption("AiPlayerbot.BotAutologin", false); + randomBotAutologin = sConfigMgr->GetOption("AiPlayerbot.RandomBotAutologin", true); + minRandomBots = sConfigMgr->GetOption("AiPlayerbot.MinRandomBots", 50); + maxRandomBots = sConfigMgr->GetOption("AiPlayerbot.MaxRandomBots", 200); + randomBotUpdateInterval = sConfigMgr->GetOption("AiPlayerbot.RandomBotUpdateInterval", MINUTE); + randomBotCountChangeMinInterval = sConfigMgr->GetOption("AiPlayerbot.RandomBotCountChangeMinInterval", 30 * MINUTE); + randomBotCountChangeMaxInterval = sConfigMgr->GetOption("AiPlayerbot.RandomBotCountChangeMaxInterval", 2 * HOUR); + minRandomBotInWorldTime = sConfigMgr->GetOption("AiPlayerbot.MinRandomBotInWorldTime", 2 * HOUR); + maxRandomBotInWorldTime = sConfigMgr->GetOption("AiPlayerbot.MaxRandomBotInWorldTime", 12 * HOUR); + minRandomBotRandomizeTime = sConfigMgr->GetOption("AiPlayerbot.MinRandomBotRandomizeTime", 2 * HOUR); + maxRandomBotRandomizeTime = sConfigMgr->GetOption("AiPlayerbot.MaxRandomRandomizeTime", 14 * 24 * HOUR); + minRandomBotChangeStrategyTime = sConfigMgr->GetOption("AiPlayerbot.MinRandomBotChangeStrategyTime", 30 * MINUTE); + maxRandomBotChangeStrategyTime = sConfigMgr->GetOption("AiPlayerbot.MaxRandomBotChangeStrategyTime", 2 * HOUR); + minRandomBotReviveTime = sConfigMgr->GetOption("AiPlayerbot.MinRandomBotReviveTime", MINUTE); + maxRandomBotReviveTime = sConfigMgr->GetOption("AiPlayerbot.MaxRandomBotReviveTime", 5 * MINUTE); + randomBotTeleportDistance = sConfigMgr->GetOption("AiPlayerbot.RandomBotTeleportDistance", 100); + randomBotsPerInterval = sConfigMgr->GetOption("AiPlayerbot.RandomBotsPerInterval", MINUTE); + minRandomBotsPriceChangeInterval = sConfigMgr->GetOption("AiPlayerbot.MinRandomBotsPriceChangeInterval", 2 * HOUR); + maxRandomBotsPriceChangeInterval = sConfigMgr->GetOption("AiPlayerbot.MaxRandomBotsPriceChangeInterval", 48 * HOUR); + 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->GetOption("AiPlayerbot.RandomBotMinLevel", 1); + randomBotMaxLevel = sConfigMgr->GetOption("AiPlayerbot.RandomBotMaxLevel", 80); + randomBotLoginAtStartup = sConfigMgr->GetOption("AiPlayerbot.RandomBotLoginAtStartup", true); + randomBotTeleLevel = sConfigMgr->GetOption("AiPlayerbot.RandomBotTeleLevel", 5); + openGoSpell = sConfigMgr->GetOption("AiPlayerbot.OpenGoSpell", 6477); - randomChangeMultiplier = sConfigMgr->GetFloatDefault("AiPlayerbot.RandomChangeMultiplier", 1.0); + randomChangeMultiplier = sConfigMgr->GetOption("AiPlayerbot.RandomChangeMultiplier", 1.0); - randomBotCombatStrategies = sConfigMgr->GetStringDefault("AiPlayerbot.RandomBotCombatStrategies", "-threat"); - randomBotNonCombatStrategies = sConfigMgr->GetStringDefault("AiPlayerbot.RandomBotNonCombatStrategies", ""); - combatStrategies = sConfigMgr->GetStringDefault("AiPlayerbot.CombatStrategies", "+custom::say"); - nonCombatStrategies = sConfigMgr->GetStringDefault("AiPlayerbot.NonCombatStrategies", "+custom::say,+return"); + randomBotCombatStrategies = sConfigMgr->GetOption("AiPlayerbot.RandomBotCombatStrategies", "-threat"); + randomBotNonCombatStrategies = sConfigMgr->GetOption("AiPlayerbot.RandomBotNonCombatStrategies", ""); + combatStrategies = sConfigMgr->GetOption("AiPlayerbot.CombatStrategies", "+custom::say"); + nonCombatStrategies = sConfigMgr->GetOption("AiPlayerbot.NonCombatStrategies", "+custom::say,+return"); - commandPrefix = sConfigMgr->GetStringDefault("AiPlayerbot.CommandPrefix", ""); - commandSeparator = sConfigMgr->GetStringDefault("AiPlayerbot.CommandSeparator", "\\\\"); + commandPrefix = sConfigMgr->GetOption("AiPlayerbot.CommandPrefix", ""); + commandSeparator = sConfigMgr->GetOption("AiPlayerbot.CommandSeparator", "\\\\"); - commandServerPort = sConfigMgr->GetIntDefault("AiPlayerbot.CommandServerPort", 8888); - perfMonEnabled = sConfigMgr->GetBoolDefault("AiPlayerbot.PerfMonEnabled", false); + commandServerPort = sConfigMgr->GetOption("AiPlayerbot.CommandServerPort", 8888); + perfMonEnabled = sConfigMgr->GetOption("AiPlayerbot.PerfMonEnabled", false); LOG_INFO("server.loading", "---------------------------------------"); LOG_INFO("server.loading", " Loading TalentSpecs "); @@ -164,12 +164,12 @@ bool PlayerbotAIConfig::Initialize() std::ostringstream os; os << "AiPlayerbot.PremadeSpecName." << cls << "." << spec; - std::string const specName = sConfigMgr->GetStringDefault(os.str().c_str(), "", false); + std::string const specName = sConfigMgr->GetOption(os.str().c_str(), "", false); if (!specName.empty()) { std::ostringstream os; os << "AiPlayerbot.PremadeSpecProb." << cls << "." << spec; - uint32 probability = sConfigMgr->GetIntDefault(os.str().c_str(), 100, false); + uint32 probability = sConfigMgr->GetOption(os.str().c_str(), 100, false); TalentPath talentPath(spec, specName, probability); @@ -178,7 +178,7 @@ bool PlayerbotAIConfig::Initialize() std::ostringstream os; os << "AiPlayerbot.PremadeSpecLink." << cls << "." << spec << "." << level; - std::string specLink = sConfigMgr->GetStringDefault(os.str().c_str(), "", false); + std::string specLink = sConfigMgr->GetOption(os.str().c_str(), "", false); specLink = specLink.substr(0, specLink.find("#", 0));; specLink = specLink.substr(0, specLink.find(" ", 0));; @@ -216,7 +216,7 @@ bool PlayerbotAIConfig::Initialize() } botCheats.clear(); - LoadListString>(sConfigMgr->GetStringDefault("AiPlayerbot.BotCheats", "taxi"), botCheats); + LoadListString>(sConfigMgr->GetOption("AiPlayerbot.BotCheats", "taxi"), botCheats); botCheatMask = 0; @@ -231,7 +231,7 @@ bool PlayerbotAIConfig::Initialize() if (std::find(botCheats.begin(), botCheats.end(), "power") != botCheats.end()) botCheatMask |= (uint32)BotCheatMask::power; - LoadListString>(sConfigMgr->GetStringDefault("AiPlayerbot.AllowedLogFiles", ""), allowedLogFiles); + LoadListString>(sConfigMgr->GetOption("AiPlayerbot.AllowedLogFiles", ""), allowedLogFiles); worldBuffs.clear(); @@ -249,60 +249,60 @@ bool PlayerbotAIConfig::Initialize() } } - randomBotAccountPrefix = sConfigMgr->GetStringDefault("AiPlayerbot.RandomBotAccountPrefix", "rndbot"); - randomBotAccountCount = sConfigMgr->GetIntDefault("AiPlayerbot.RandomBotAccountCount", 200); - deleteRandomBotAccounts = sConfigMgr->GetBoolDefault("AiPlayerbot.DeleteRandomBotAccounts", false); - randomBotGuildCount = sConfigMgr->GetIntDefault("AiPlayerbot.RandomBotGuildCount", 20); - deleteRandomBotGuilds = sConfigMgr->GetBoolDefault("AiPlayerbot.DeleteRandomBotGuilds", false); + randomBotAccountPrefix = sConfigMgr->GetOption("AiPlayerbot.RandomBotAccountPrefix", "rndbot"); + randomBotAccountCount = sConfigMgr->GetOption("AiPlayerbot.RandomBotAccountCount", 200); + deleteRandomBotAccounts = sConfigMgr->GetOption("AiPlayerbot.DeleteRandomBotAccounts", false); + randomBotGuildCount = sConfigMgr->GetOption("AiPlayerbot.RandomBotGuildCount", 20); + deleteRandomBotGuilds = sConfigMgr->GetOption("AiPlayerbot.DeleteRandomBotGuilds", false); - guildTaskEnabled = sConfigMgr->GetBoolDefault("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); - maxGuildTaskAdvertisementTime = sConfigMgr->GetIntDefault("AiPlayerbot.MaxGuildTaskAdvertisementTime", 12 * 3600); - minGuildTaskRewardTime = sConfigMgr->GetIntDefault("AiPlayerbot.MinGuildTaskRewardTime", 300); - maxGuildTaskRewardTime = sConfigMgr->GetIntDefault("AiPlayerbot.MaxGuildTaskRewardTime", 3600); - guildTaskAdvertCleanupTime = sConfigMgr->GetIntDefault("AiPlayerbot.GuildTaskAdvertCleanupTime", 300); - guildTaskKillTaskDistance = sConfigMgr->GetIntDefault("AiPlayerbot.GuildTaskKillTaskDistance", 2000); - targetPosRecalcDistance = sConfigMgr->GetFloatDefault("AiPlayerbot.TargetPosRecalcDistance", 0.1f); + guildTaskEnabled = sConfigMgr->GetOption("AiPlayerbot.EnableGuildTasks", true); + minGuildTaskChangeTime = sConfigMgr->GetOption("AiPlayerbot.MinGuildTaskChangeTime", 3 * 24 * 3600); + maxGuildTaskChangeTime = sConfigMgr->GetOption("AiPlayerbot.MaxGuildTaskChangeTime", 4 * 24 * 3600); + minGuildTaskAdvertisementTime = sConfigMgr->GetOption("AiPlayerbot.MinGuildTaskAdvertisementTime", 300); + maxGuildTaskAdvertisementTime = sConfigMgr->GetOption("AiPlayerbot.MaxGuildTaskAdvertisementTime", 12 * 3600); + minGuildTaskRewardTime = sConfigMgr->GetOption("AiPlayerbot.MinGuildTaskRewardTime", 300); + maxGuildTaskRewardTime = sConfigMgr->GetOption("AiPlayerbot.MaxGuildTaskRewardTime", 3600); + guildTaskAdvertCleanupTime = sConfigMgr->GetOption("AiPlayerbot.GuildTaskAdvertCleanupTime", 300); + guildTaskKillTaskDistance = sConfigMgr->GetOption("AiPlayerbot.GuildTaskKillTaskDistance", 2000); + targetPosRecalcDistance = sConfigMgr->GetOption("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); - 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); - minEnchantingBotLevel = sConfigMgr->GetIntDefault("AiPlayerbot.MinEnchantingBotLevel", 60); - randombotStartingLevel = sConfigMgr->GetIntDefault("AiPlayerbot.RandombotStartingLevel", 5); - gearscorecheck = sConfigMgr->GetBoolDefault("AiPlayerbot.GearScoreCheck", false); - randomBotPreQuests = sConfigMgr->GetBoolDefault("AiPlayerbot.PreQuests", true); + enableGreet = sConfigMgr->GetOption("AiPlayerbot.EnableGreet", true); + disableRandomLevels = sConfigMgr->GetOption("AiPlayerbot.DisableRandomLevels", false); + randomBotRandomPassword = sConfigMgr->GetOption("AiPlayerbot.RandomBotRandomPassword", true); + playerbotsXPrate = sConfigMgr->GetOption("AiPlayerbot.KillXPRate", 1); + botActiveAlone = sConfigMgr->GetOption("AiPlayerbot.BotActiveAlone", 10); + randombotsWalkingRPG = sConfigMgr->GetOption("AiPlayerbot.RandombotsWalkingRPG", false); + randombotsWalkingRPGInDoors = sConfigMgr->GetOption("AiPlayerbot.RandombotsWalkingRPG.InDoors", false); + minEnchantingBotLevel = sConfigMgr->GetOption("AiPlayerbot.MinEnchantingBotLevel", 60); + randombotStartingLevel = sConfigMgr->GetOption("AiPlayerbot.RandombotStartingLevel", 5); + 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); - 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); + autoPickReward = sConfigMgr->GetOption("AiPlayerbot.AutoPickReward", "yes"); + autoEquipUpgradeLoot = sConfigMgr->GetOption("AiPlayerbot.AutoEquipUpgradeLoot", true); + syncQuestWithPlayer = sConfigMgr->GetOption("AiPlayerbot.SyncQuestWithPlayer", false); + syncQuestForPlayer = sConfigMgr->GetOption("AiPlayerbot.SyncQuestForPlayer", false); + autoTrainSpells = sConfigMgr->GetOption("AiPlayerbot.AutoTrainSpells", "yes"); + autoPickTalents = sConfigMgr->GetOption("AiPlayerbot.AutoPickTalents", "full"); + 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); + randomBotArenaTeamCount = sConfigMgr->GetOption("AiPlayerbot.RandomBotArenaTeamCount", 20); + deleteRandomBotArenaTeams = sConfigMgr->GetOption("AiPlayerbot.DeleteRandomBotArenaTeams", false); - selfBotLevel = sConfigMgr->GetIntDefault("AiPlayerbot.SelfBotLevel", 1); + selfBotLevel = sConfigMgr->GetOption("AiPlayerbot.SelfBotLevel", 1); RandomPlayerbotFactory::CreateRandomBots(); PlayerbotFactory::Init(); @@ -424,7 +424,7 @@ void PlayerbotAIConfig::loadWorldBuf(uint32 factionId1, uint32 classId1, uint32 std::ostringstream os; os << "AiPlayerbot.WorldBuff." << factionId1 << "." << classId1 << "." << minLevel1 << "." << maxLevel1; - LoadList>(sConfigMgr->GetStringDefault(os.str().c_str(), "", false), buffs); + LoadList>(sConfigMgr->GetOption(os.str().c_str(), "", false), buffs); for (auto buff : buffs) { @@ -437,7 +437,7 @@ void PlayerbotAIConfig::loadWorldBuf(uint32 factionId1, uint32 classId1, uint32 std::ostringstream os; os << "AiPlayerbot.WorldBuff." << factionId1 << "." << classId1 << "." << minLevel1; - LoadList>(sConfigMgr->GetStringDefault(os.str().c_str(), "", false), buffs); + LoadList>(sConfigMgr->GetOption(os.str().c_str(), "", false), buffs); for (auto buff : buffs) { @@ -451,7 +451,7 @@ void PlayerbotAIConfig::loadWorldBuf(uint32 factionId1, uint32 classId1, uint32 std::ostringstream os; os << "AiPlayerbot.WorldBuff." << factionId1 << "." << factionId1 << "." << classId1; - LoadList>(sConfigMgr->GetStringDefault(os.str().c_str(), "", false), buffs); + LoadList>(sConfigMgr->GetOption(os.str().c_str(), "", false), buffs); for (auto buff : buffs) { @@ -465,7 +465,7 @@ void PlayerbotAIConfig::loadWorldBuf(uint32 factionId1, uint32 classId1, uint32 std::ostringstream os; os << "AiPlayerbot.WorldBuff." << factionId1; - LoadList>(sConfigMgr->GetStringDefault(os.str().c_str(), "", false), buffs); + LoadList>(sConfigMgr->GetOption(os.str().c_str(), "", false), buffs); for (auto buff : buffs) { @@ -479,7 +479,7 @@ void PlayerbotAIConfig::loadWorldBuf(uint32 factionId1, uint32 classId1, uint32 std::ostringstream os; os << "AiPlayerbot.WorldBuff"; - LoadList>(sConfigMgr->GetStringDefault(os.str().c_str(), "", false), buffs); + LoadList>(sConfigMgr->GetOption(os.str().c_str(), "", false), buffs); for (auto buff : buffs) { diff --git a/src/PlayerbotMgr.h b/src/PlayerbotMgr.h index da552bad..27c56580 100644 --- a/src/PlayerbotMgr.h +++ b/src/PlayerbotMgr.h @@ -35,7 +35,7 @@ class PlayerbotHolder : public PlayerbotAIBase PlayerBotMap::const_iterator GetPlayerBotsBegin() const { return playerBots.begin(); } PlayerBotMap::const_iterator GetPlayerBotsEnd() const { return playerBots.end(); } - void UpdateAIInternal(uint32 elapsed, bool minimal = false) override { }; + void UpdateAIInternal([[maybe_unused]] uint32 elapsed, [[maybe_unused]] bool minimal = false) override { }; void UpdateSessions(); void HandleBotPackets(WorldSession* session); diff --git a/src/TravelMgr.cpp b/src/TravelMgr.cpp index cf24d85a..2feee049 100644 --- a/src/TravelMgr.cpp +++ b/src/TravelMgr.cpp @@ -350,7 +350,7 @@ Map* WorldPosition::getMap() return sMapMgr->FindMap(GetMapId(), getMapEntry()->Instanceable() ? getInstanceId() : 0); } -const float WorldPosition::getHeight() +float WorldPosition::getHeight() // remove const - whipowill { return getMap()->GetHeight(getX(), getY(), getZ()); } diff --git a/src/TravelMgr.h b/src/TravelMgr.h index 5af84c05..55664ba4 100644 --- a/src/TravelMgr.h +++ b/src/TravelMgr.h @@ -242,7 +242,7 @@ class WorldPosition : public WorldLocation MapEntry const* getMapEntry(); uint32 getInstanceId(); Map* getMap(); - const float getHeight(); + float getHeight(); // remove const - whipowill std::set getTransports(uint32 entry = 0); @@ -346,7 +346,7 @@ inline ByteBuffer& operator<<(ByteBuffer& b, WorldPosition& guidP) return b; } -inline ByteBuffer& operator>>(ByteBuffer& b, WorldPosition& g) +inline ByteBuffer& operator>>(ByteBuffer& b, [[maybe_unused]] WorldPosition& g) { uint32 mapid; float coord_x; @@ -557,7 +557,7 @@ class TravelDestination } virtual Quest const* GetQuestTemplate() { return nullptr; } - virtual bool isActive(Player* bot) { return false; } + virtual bool isActive([[maybe_unused]] Player* bot) { return false; } bool isFull(bool ignoreFull = false); @@ -600,13 +600,13 @@ class NullTravelDestination : public TravelDestination Quest const* GetQuestTemplate() override { return nullptr; } - bool isActive(Player* bot) override { return false; } + bool isActive([[maybe_unused]] Player* bot) override { return false; } std::string const getName() override { return "NullTravelDestination"; } std::string const getTitle() override { return "no destination"; } - bool isIn(WorldPosition* pos, float radius = 0.f) override { return true; } - bool isOut(WorldPosition* pos, float radius = 0.f) override { return false; } + bool isIn([[maybe_unused]] WorldPosition* pos, [[maybe_unused]] float radius = 0.f) override { return true; } + bool isOut([[maybe_unused]] WorldPosition* pos, [[maybe_unused]] float radius = 0.f) override { return false; } }; //A travel target specifically related to a quest. diff --git a/src/TravelNode.cpp b/src/TravelNode.cpp index 0d9da41c..ecae1930 100644 --- a/src/TravelNode.cpp +++ b/src/TravelNode.cpp @@ -579,7 +579,7 @@ bool TravelNode::isEqual(TravelNode* compareNode) return true; } -void TravelNode::print(bool printFailed) +void TravelNode::print([[maybe_unused]] bool printFailed) { WorldPosition* startPosition = getPosition(); @@ -901,7 +901,7 @@ float TravelNodeRoute::getTotalDistance() return totalLength; } -TravelPath TravelNodeRoute::buildPath(std::vector pathToStart, std::vector pathToEnd, Unit* bot) +TravelPath TravelNodeRoute::buildPath(std::vector pathToStart, std::vector pathToEnd, [[maybe_unused]] Unit* bot) { TravelPath travelPath; @@ -1036,7 +1036,7 @@ TravelNodeMap::TravelNodeMap(TravelNodeMap* baseMap) baseMap->m_nMapMtx.unlock_shared(); } -TravelNode* TravelNodeMap::addNode(WorldPosition pos, std::string const preferedName, bool isImportant, bool checkDuplicate, bool transport,uint32 transportId) +TravelNode* TravelNodeMap::addNode(WorldPosition pos, std::string const preferedName, bool isImportant, bool checkDuplicate, [[maybe_unused]] bool transport, [[maybe_unused]] uint32 transportId) { TravelNode* newNode; @@ -1124,7 +1124,7 @@ std::vector TravelNodeMap::getNodes(WorldPosition pos, float range) return std::move(retVec); } -TravelNode* TravelNodeMap::getNode(WorldPosition pos, std::vector& ppath, Unit* bot, float range) +TravelNode* TravelNodeMap::getNode(WorldPosition pos, [[maybe_unused]] std::vector& ppath, Unit* bot, float range) { float x = pos.getX(); float y = pos.getY(); diff --git a/src/TravelNode.h b/src/TravelNode.h index ec90fb86..46b1d801 100644 --- a/src/TravelNode.h +++ b/src/TravelNode.h @@ -66,8 +66,7 @@ class TravelNodePath //Constructor TravelNodePath(float distance = 0.1f, float extraCost = 0, uint8 pathType = (uint8)TravelNodePathType::walk, uint32 pathObject = 0, bool calculated = false, std::vector maxLevelCreature = { 0, 0, 0 }, float swimDistance = 0) - : distance(distance), extraCost(extraCost), pathType(TravelNodePathType(pathType)), pathObject(pathObject), calculated(calculated), - maxLevelCreature(maxLevelCreature), swimDistance(swimDistance) + : extraCost(extraCost), calculated(calculated), distance(distance), maxLevelCreature(maxLevelCreature), swimDistance(swimDistance), pathType(TravelNodePathType(pathType)), pathObject(pathObject) // reorder args - whipowill { if (pathType != (uint8)TravelNodePathType::walk) complete = true; diff --git a/src/strategy/Action.h b/src/strategy/Action.h index 5ce833f9..f67f9ed6 100644 --- a/src/strategy/Action.h +++ b/src/strategy/Action.h @@ -16,8 +16,8 @@ class Unit; class NextAction { public: - NextAction(std::string const name, float relevance = 0.0f) : name(name), relevance(relevance) { } - NextAction(NextAction const& o) : name(o.name), relevance(o.relevance) { } + NextAction(std::string const name, float relevance = 0.0f) : relevance(relevance), name(name) { } // name after relevance - whipowill + NextAction(NextAction const& o) : relevance(o.relevance), name(o.name) { } // name after relevance - whipowill std::string const getName() { return name; } float getRelevance() {return relevance;} @@ -43,10 +43,10 @@ class Action : public AiNamedObject Aoe = 2 }; - Action(PlayerbotAI* botAI, std::string const name = "action") : verbose(false), AiNamedObject(botAI, name) { } + Action(PlayerbotAI* botAI, std::string const name = "action") : AiNamedObject(botAI, name), verbose(false) { } // verbose after ainamedobject - whipowill virtual ~Action(void) { } - virtual bool Execute(Event event) { return true; } + virtual bool Execute([[maybe_unused]] Event event) { return true; } virtual bool isPossible() { return true; } virtual bool isUseful() { return true; } virtual NextAction** getPrerequisites() { return nullptr; } @@ -71,7 +71,7 @@ class ActionNode { public: ActionNode(std::string const name, NextAction** prerequisites = nullptr, NextAction** alternatives = nullptr, NextAction** continuers = nullptr) : - action(nullptr), name(name), prerequisites(prerequisites), alternatives(alternatives), continuers(continuers) { } + name(name), action(nullptr), continuers(continuers), alternatives(alternatives), prerequisites(prerequisites) { } // reorder arguments - whipowill virtual ~ActionNode() { diff --git a/src/strategy/ItemVisitors.h b/src/strategy/ItemVisitors.h index 8bb521b0..6a981aac 100644 --- a/src/strategy/ItemVisitors.h +++ b/src/strategy/ItemVisitors.h @@ -111,7 +111,7 @@ class FindItemsToTradeByClassVisitor : public IterateItemsVisitor { public: FindItemsToTradeByClassVisitor(uint32 itemClass, uint32 itemSubClass, uint32 count) - : IterateItemsVisitor(), count(count), itemClass(itemClass), itemSubClass(itemSubClass) { } + : IterateItemsVisitor(), itemClass(itemClass), itemSubClass(itemSubClass), count(count) { } // reorder args - whipowill bool Visit(Item* item) override { @@ -181,7 +181,7 @@ class QueryNamedItemCountVisitor : public QueryItemCountVisitor class FindNamedItemVisitor : public FindItemVisitor { public: - FindNamedItemVisitor(Player* bot, std::string const name) : FindItemVisitor(), name(name) { } + FindNamedItemVisitor([[maybe_unused]] Player* bot, std::string const name) : FindItemVisitor(), name(name) { } bool Accept(ItemTemplate const* proto) override { diff --git a/src/strategy/Multiplier.h b/src/strategy/Multiplier.h index a3a67b01..7bb39c73 100644 --- a/src/strategy/Multiplier.h +++ b/src/strategy/Multiplier.h @@ -16,7 +16,7 @@ class Multiplier : public AiNamedObject Multiplier(PlayerbotAI* botAI, std::string const name) : AiNamedObject(botAI, name) {} virtual ~Multiplier() { } - virtual float GetValue(Action* action) { return 1.0f; } + virtual float GetValue([[maybe_unused]] Action* action) { return 1.0f; } }; #endif diff --git a/src/strategy/Strategy.cpp b/src/strategy/Strategy.cpp index 6b97de14..201e6997 100644 --- a/src/strategy/Strategy.cpp +++ b/src/strategy/Strategy.cpp @@ -24,7 +24,7 @@ class ActionNodeFactoryInternal : public NamedObjectFactory } private: - static ActionNode* melee(PlayerbotAI* botAI) + static ActionNode* melee([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("melee", /*P*/ nullptr, @@ -32,7 +32,7 @@ class ActionNodeFactoryInternal : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* healthstone(PlayerbotAI* botAI) + static ActionNode* healthstone([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("healthstone", /*P*/ nullptr, @@ -40,7 +40,7 @@ class ActionNodeFactoryInternal : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* follow_master_random(PlayerbotAI* botAI) + static ActionNode* follow_master_random([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("be near", /*P*/ nullptr, @@ -48,7 +48,7 @@ class ActionNodeFactoryInternal : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* attack_anything(PlayerbotAI* botAI) + static ActionNode* attack_anything([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("attack anything", /*P*/ nullptr, @@ -56,7 +56,7 @@ class ActionNodeFactoryInternal : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* move_random(PlayerbotAI* botAI) + static ActionNode* move_random([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("move random", /*P*/ nullptr, @@ -64,7 +64,7 @@ class ActionNodeFactoryInternal : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* move_to_loot(PlayerbotAI* botAI) + static ActionNode* move_to_loot([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("move to loot", /*P*/ nullptr, @@ -72,7 +72,7 @@ class ActionNodeFactoryInternal : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* food(PlayerbotAI* botAI) + static ActionNode* food([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("food", /*P*/ nullptr, @@ -80,7 +80,7 @@ class ActionNodeFactoryInternal : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* drink(PlayerbotAI* botAI) + static ActionNode* drink([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("drink", /*P*/ nullptr, @@ -88,7 +88,7 @@ class ActionNodeFactoryInternal : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* mana_potion(PlayerbotAI* botAI) + static ActionNode* mana_potion([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("mana potion", /*P*/ nullptr, @@ -96,7 +96,7 @@ class ActionNodeFactoryInternal : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* healing_potion(PlayerbotAI* botAI) + static ActionNode* healing_potion([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("healing potion", /*P*/ nullptr, @@ -104,7 +104,7 @@ class ActionNodeFactoryInternal : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* flee(PlayerbotAI* botAI) + static ActionNode* flee([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("flee", /*P*/ nullptr, diff --git a/src/strategy/Strategy.h b/src/strategy/Strategy.h index a63d31df..0bfffd43 100644 --- a/src/strategy/Strategy.h +++ b/src/strategy/Strategy.h @@ -44,8 +44,8 @@ class Strategy : public PlayerbotAIAware virtual ~Strategy() { } virtual NextAction** getDefaultActions() { return nullptr; } - virtual void InitTriggers(std::vector &triggers) { } - virtual void InitMultipliers(std::vector &multipliers) { } + virtual void InitTriggers([[maybe_unused]] std::vector &triggers) { } + virtual void InitMultipliers([[maybe_unused]] std::vector &multipliers) { } virtual std::string const getName() = 0; virtual uint32 GetType() const { return STRATEGY_TYPE_GENERIC; } virtual ActionNode* GetAction(std::string const name); diff --git a/src/strategy/Trigger.h b/src/strategy/Trigger.h index 737509bf..46a03843 100644 --- a/src/strategy/Trigger.h +++ b/src/strategy/Trigger.h @@ -19,8 +19,8 @@ class Trigger : public AiNamedObject virtual ~Trigger() { } virtual Event Check(); - virtual void ExternalEvent(std::string const param, Player* owner = nullptr) { } - virtual void ExternalEvent(WorldPacket& packet, Player* owner = nullptr) { } + virtual void ExternalEvent([[maybe_unused]] std::string const param, [[maybe_unused]] Player* owner = nullptr) { } + virtual void ExternalEvent([[maybe_unused]] WorldPacket& packet, [[maybe_unused]] Player* owner = nullptr) { } virtual bool IsActive() { return false; } virtual NextAction** getHandlers() { return nullptr; } void Update() { } @@ -39,7 +39,7 @@ class Trigger : public AiNamedObject class TriggerNode { public: - TriggerNode(std::string const name, NextAction** handlers = nullptr) : name(name), handlers(handlers), trigger(nullptr) { } + TriggerNode(std::string const name, NextAction** handlers = nullptr) : trigger(nullptr), handlers(handlers), name(name) { } // reorder args - whipowill virtual ~TriggerNode() { diff --git a/src/strategy/Value.h b/src/strategy/Value.h index 50de7262..0fc1c3c9 100644 --- a/src/strategy/Value.h +++ b/src/strategy/Value.h @@ -24,7 +24,7 @@ class UntypedValue : public AiNamedObject virtual void Reset() { } virtual std::string const Format() { return "?"; } virtual std::string const Save() { return "?"; } - virtual bool Load(std::string const value) { return false; } + virtual bool Load([[maybe_unused]] std::string const value) { return false; } }; template @@ -135,7 +135,7 @@ class MemoryCalculatedValue : public CalculatedValue return true; } - void Set(T value) override + void Set([[maybe_unused]] T value) override { CalculatedValue::Set(this->value); UpdateChange(); diff --git a/src/strategy/actions/MailAction.h b/src/strategy/actions/MailAction.h index f6e948f7..9bf864d9 100644 --- a/src/strategy/actions/MailAction.h +++ b/src/strategy/actions/MailAction.h @@ -15,9 +15,9 @@ struct Mail; class MailProcessor { public: - virtual bool Before(PlayerbotAI* botAI) { return true; } + virtual bool Before([[maybe_unused]] PlayerbotAI* botAI) { return true; } virtual bool Process(uint32 index, Mail* mail, PlayerbotAI* botAI) = 0; - virtual bool After(PlayerbotAI* botAI) { return true; } + virtual bool After([[maybe_unused]] PlayerbotAI* botAI) { return true; } static ObjectGuid FindMailbox(PlayerbotAI* botAI); diff --git a/src/strategy/actions/MovementActions.cpp b/src/strategy/actions/MovementActions.cpp index 6a350bf7..7b363929 100644 --- a/src/strategy/actions/MovementActions.cpp +++ b/src/strategy/actions/MovementActions.cpp @@ -1048,7 +1048,7 @@ bool MovementAction::Flee(Unit *target) } } - HostileReference* ref = target->getThreatMgr().getCurrentVictim(); + HostileReference* ref = target->GetThreatMgr().getCurrentVictim(); if (ref && ref->getTarget() == bot) // bot is target - try to flee to tank or master { if (Group* group = bot->GetGroup()) diff --git a/src/strategy/deathknight/BloodDKStrategy.cpp b/src/strategy/deathknight/BloodDKStrategy.cpp index af7da39a..3a4476b2 100644 --- a/src/strategy/deathknight/BloodDKStrategy.cpp +++ b/src/strategy/deathknight/BloodDKStrategy.cpp @@ -33,7 +33,7 @@ class BloodDKStrategyActionNodeFactory : public NamedObjectFactory } private: - static ActionNode* rune_strike(PlayerbotAI* botAI) + static ActionNode* rune_strike([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("rune strike", /*P*/ NextAction::array(0, new NextAction("frost presence"), nullptr), @@ -41,7 +41,7 @@ class BloodDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* heart_strike(PlayerbotAI* botAI) + static ActionNode* heart_strike([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("heart strike", /*P*/ NextAction::array(0, new NextAction("frost presence"), nullptr), @@ -49,7 +49,7 @@ class BloodDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* death_strike(PlayerbotAI* botAI) + static ActionNode* death_strike([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("death strike", /*P*/ NextAction::array(0, new NextAction("frost presence"), nullptr), diff --git a/src/strategy/deathknight/FrostDKStrategy.cpp b/src/strategy/deathknight/FrostDKStrategy.cpp index 7326c3e6..9a263f98 100644 --- a/src/strategy/deathknight/FrostDKStrategy.cpp +++ b/src/strategy/deathknight/FrostDKStrategy.cpp @@ -30,7 +30,7 @@ class FrostDKStrategyActionNodeFactory : public NamedObjectFactory } private: - static ActionNode* obliterate(PlayerbotAI* botAI) + static ActionNode* obliterate([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("obliterate", /*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr), @@ -38,7 +38,7 @@ class FrostDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* rune_strike(PlayerbotAI* botAI) + static ActionNode* rune_strike([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("rune strike", /*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr), @@ -46,7 +46,7 @@ class FrostDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* frost_strike(PlayerbotAI* botAI) + static ActionNode* frost_strike([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("frost strike", /*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr), @@ -54,7 +54,7 @@ class FrostDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* howling_blast(PlayerbotAI* botAI) + static ActionNode* howling_blast([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("howling blast", /*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr), diff --git a/src/strategy/deathknight/GenericDKNonCombatStrategy.cpp b/src/strategy/deathknight/GenericDKNonCombatStrategy.cpp index 883edf24..3f2cecc2 100644 --- a/src/strategy/deathknight/GenericDKNonCombatStrategy.cpp +++ b/src/strategy/deathknight/GenericDKNonCombatStrategy.cpp @@ -15,7 +15,7 @@ class GenericDKNonCombatStrategyActionNodeFactory : public NamedObjectFactory } private: - static ActionNode* death_coil(PlayerbotAI* botAI) + static ActionNode* death_coil([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("death coil", /*P*/ nullptr, @@ -58,7 +58,7 @@ class GenericDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* death_grip(PlayerbotAI* botAI) + static ActionNode* death_grip([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("death grip", /*P*/ nullptr, @@ -66,7 +66,7 @@ class GenericDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* plague_strike(PlayerbotAI* botAI) + static ActionNode* plague_strike([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("plague strike", /*P*/ nullptr, @@ -74,7 +74,7 @@ class GenericDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* icy_touch(PlayerbotAI* botAI) + static ActionNode* icy_touch([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("icy touch", /*P*/ nullptr, @@ -82,7 +82,7 @@ class GenericDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* heart_strike(PlayerbotAI* botAI) + static ActionNode* heart_strike([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("heart strike", /*P*/ nullptr, @@ -90,7 +90,7 @@ class GenericDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* pestilence(PlayerbotAI* botAI) + static ActionNode* pestilence([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("pestilence", /*P*/ nullptr, @@ -98,7 +98,7 @@ class GenericDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* horn_of_winter(PlayerbotAI* botAI) + static ActionNode* horn_of_winter([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("horn of winter", /*P*/ nullptr, @@ -106,7 +106,7 @@ class GenericDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* bone_shield(PlayerbotAI* botAI) + static ActionNode* bone_shield([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("bone shield", /*P*/ nullptr, @@ -114,7 +114,7 @@ class GenericDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* killing_machine(PlayerbotAI* botAI) + static ActionNode* killing_machine([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("killing machine", /*P*/ nullptr, @@ -122,7 +122,7 @@ class GenericDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* corpse_explosion(PlayerbotAI* botAI) + static ActionNode* corpse_explosion([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("corpse explosion", /*P*/ nullptr, @@ -130,7 +130,7 @@ class GenericDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* anti_magic_zone(PlayerbotAI* botAI) + static ActionNode* anti_magic_zone([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("anti magic zone", /*P*/ nullptr, @@ -138,7 +138,7 @@ class GenericDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* icebound_fortitude(PlayerbotAI* botAI) + static ActionNode* icebound_fortitude([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("icebound fortitude", /*P*/ nullptr, diff --git a/src/strategy/deathknight/UnholyDKStrategy.cpp b/src/strategy/deathknight/UnholyDKStrategy.cpp index 6f3d9a2b..1e255b10 100644 --- a/src/strategy/deathknight/UnholyDKStrategy.cpp +++ b/src/strategy/deathknight/UnholyDKStrategy.cpp @@ -30,7 +30,7 @@ class UnholyDKStrategyActionNodeFactory : public NamedObjectFactory } private: - static ActionNode* death_strike(PlayerbotAI* botAI) + static ActionNode* death_strike([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("death strike", /*P*/ NextAction::array(0, new NextAction("unholy pressence"), nullptr), @@ -38,7 +38,7 @@ class UnholyDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* corpse_explosion(PlayerbotAI* botAI) + static ActionNode* corpse_explosion([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("corpse explosion", /*P*/ NextAction::array(0, new NextAction("unholy pressence"), nullptr), @@ -46,7 +46,7 @@ class UnholyDKStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* scourge_strike(PlayerbotAI* botAI) + static ActionNode* scourge_strike([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("scourge strike", /*P*/ NextAction::array(0, new NextAction("unholy pressence"), nullptr), diff --git a/src/strategy/druid/BearTankDruidStrategy.cpp b/src/strategy/druid/BearTankDruidStrategy.cpp index bbd92e7e..80a2807b 100644 --- a/src/strategy/druid/BearTankDruidStrategy.cpp +++ b/src/strategy/druid/BearTankDruidStrategy.cpp @@ -25,7 +25,7 @@ class BearTankDruidStrategyActionNodeFactory : public NamedObjectFactory } private: - static ActionNode* viper_sting(PlayerbotAI* botAI) + static ActionNode* viper_sting([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("viper sting", /*P*/ nullptr, @@ -26,7 +26,7 @@ class DpsHunterStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* aimed_shot(PlayerbotAI* botAI) + static ActionNode* aimed_shot([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("aimed shot", /*P*/ nullptr, @@ -34,7 +34,7 @@ class DpsHunterStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* chimera_shot(PlayerbotAI* botAI) + static ActionNode* chimera_shot([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("chimera shot", /*P*/ nullptr, @@ -42,7 +42,7 @@ class DpsHunterStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* explosive_shot(PlayerbotAI* botAI) + static ActionNode* explosive_shot([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("explosive shot", /*P*/ nullptr, @@ -50,7 +50,7 @@ class DpsHunterStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* concussive_shot(PlayerbotAI* botAI) + static ActionNode* concussive_shot([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("concussive shot", /*P*/ nullptr, diff --git a/src/strategy/hunter/GenericHunterNonCombatStrategy.cpp b/src/strategy/hunter/GenericHunterNonCombatStrategy.cpp index 933d8df9..c4b7e83f 100644 --- a/src/strategy/hunter/GenericHunterNonCombatStrategy.cpp +++ b/src/strategy/hunter/GenericHunterNonCombatStrategy.cpp @@ -16,7 +16,7 @@ class GenericHunterNonCombatStrategyActionNodeFactory : public NamedObjectFactor } private: - static ActionNode* rapid_fire(PlayerbotAI* botAI) + static ActionNode* rapid_fire([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("rapid fire", /*P*/ nullptr, @@ -24,7 +24,7 @@ class GenericHunterNonCombatStrategyActionNodeFactory : public NamedObjectFactor /*C*/ nullptr); } - static ActionNode* aspect_of_the_pack(PlayerbotAI* botAI) + static ActionNode* aspect_of_the_pack([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("aspect of the pack", /*P*/ nullptr, diff --git a/src/strategy/hunter/GenericHunterStrategy.cpp b/src/strategy/hunter/GenericHunterStrategy.cpp index c81c155e..0ad96011 100644 --- a/src/strategy/hunter/GenericHunterStrategy.cpp +++ b/src/strategy/hunter/GenericHunterStrategy.cpp @@ -19,7 +19,7 @@ class GenericHunterStrategyActionNodeFactory : public NamedObjectFactory } private: - static ActionNode* riposte(PlayerbotAI* botAI) + static ActionNode* riposte([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("riposte", /*P*/ nullptr, @@ -28,7 +28,7 @@ class DpsRogueStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* mutilate(PlayerbotAI* botAI) + static ActionNode* mutilate([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("mutilate", /*P*/ nullptr, @@ -36,7 +36,7 @@ class DpsRogueStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* sinister_strike(PlayerbotAI* botAI) + static ActionNode* sinister_strike([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("sinister strike", /*P*/ nullptr, @@ -44,7 +44,7 @@ class DpsRogueStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* kick(PlayerbotAI* botAI) + static ActionNode* kick([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("kick", /*P*/ nullptr, @@ -52,7 +52,7 @@ class DpsRogueStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* kidney_shot(PlayerbotAI* botAI) + static ActionNode* kidney_shot([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("kidney shot", /*P*/ nullptr, @@ -60,7 +60,7 @@ class DpsRogueStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* rupture(PlayerbotAI* botAI) + static ActionNode* rupture([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("rupture", /*P*/ nullptr, @@ -68,7 +68,7 @@ class DpsRogueStrategyActionNodeFactory : public NamedObjectFactory /*C*/ nullptr); } - static ActionNode* backstab(PlayerbotAI* botAI) + static ActionNode* backstab([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode ("backstab", /*P*/ nullptr, diff --git a/src/strategy/shaman/CasterShamanStrategy.cpp b/src/strategy/shaman/CasterShamanStrategy.cpp index 5f4716c1..c5b56300 100644 --- a/src/strategy/shaman/CasterShamanStrategy.cpp +++ b/src/strategy/shaman/CasterShamanStrategy.cpp @@ -14,7 +14,7 @@ class CasterShamanStrategyActionNodeFactory : public NamedObjectFactorynext(); } - ref = target->getThreatMgr().getCurrentVictim(); + ref = target->GetThreatMgr().getCurrentVictim(); if (ref) { if (Unit* victim = ref->getTarget()) diff --git a/src/strategy/values/AttackersValue.cpp b/src/strategy/values/AttackersValue.cpp index 5d788e8d..bc94d045 100644 --- a/src/strategy/values/AttackersValue.cpp +++ b/src/strategy/values/AttackersValue.cpp @@ -72,7 +72,7 @@ void AttackersValue::AddAttackersOf(Player* player, std::set& targets) { if (!player->GetGroup()) { - if (!unit->getThreatMgr().getThreat(player) && (!unit->getThreatMgr().getCurrentVictim() || unit->getThreatMgr().getCurrentVictim()->getTarget() != player)) + if (!unit->GetThreatMgr().getThreat(player) && (!unit->GetThreatMgr().getCurrentVictim() || unit->GetThreatMgr().getCurrentVictim()->getTarget() != player)) continue; } @@ -107,7 +107,7 @@ bool AttackersValue::IsPossibleTarget(Unit* attacker, Player* bot, float range) bool leaderHasThreat = false; if (attacker && bot->GetGroup() && botAI->GetMaster()) - leaderHasThreat = attacker->getThreatMgr().getThreat(botAI->GetMaster()); + leaderHasThreat = attacker->GetThreatMgr().getThreat(botAI->GetMaster()); bool isMemberBotGroup = false; if (bot->GetGroup() && botAI->GetMaster()) @@ -131,7 +131,7 @@ bool AttackersValue::IsPossibleTarget(Unit* attacker, Player* bot, float range) bool AttackersValue::IsValidTarget(Unit *attacker, Player *bot) { - return IsPossibleTarget(attacker, bot) && (attacker->getThreatMgr().getCurrentVictim() || attacker->GetGuidValue(UNIT_FIELD_TARGET) || + return IsPossibleTarget(attacker, bot) && (attacker->GetThreatMgr().getCurrentVictim() || attacker->GetGuidValue(UNIT_FIELD_TARGET) || attacker->GetGUID().IsPlayer() || attacker->GetGUID() == GET_PLAYERBOT_AI(bot)->GetAiObjectContext()->GetValue("pull target")->Get()); } bool PossibleAddsValue::Calculate() @@ -146,7 +146,7 @@ bool PossibleAddsValue::Calculate() if (Unit* add = botAI->GetUnit(guid)) { - if (!add->GetTarget() && !add->getThreatMgr().getCurrentVictim() && add->IsHostileTo(bot)) + if (!add->GetTarget() && !add->GetThreatMgr().getCurrentVictim() && add->IsHostileTo(bot)) { for (ObjectGuid const attackerGUID : attackers) { diff --git a/src/strategy/values/TargetValue.cpp b/src/strategy/values/TargetValue.cpp index facd11b4..f56bdc99 100644 --- a/src/strategy/values/TargetValue.cpp +++ b/src/strategy/values/TargetValue.cpp @@ -21,7 +21,7 @@ Unit* TargetValue::FindTarget(FindTargetStrategy* strategy) if (!unit) continue; - ThreatMgr &ThreatMgr = unit->getThreatMgr(); + ThreatMgr &ThreatMgr = unit->GetThreatMgr(); strategy->CheckAttacker(unit, &ThreatMgr); } diff --git a/src/strategy/values/ThreatValues.cpp b/src/strategy/values/ThreatValues.cpp index 6a5af135..39b9a885 100644 --- a/src/strategy/values/ThreatValues.cpp +++ b/src/strategy/values/ThreatValues.cpp @@ -42,7 +42,7 @@ uint8 ThreatValue::Calculate(Unit* target) if (!group) return 0; - float botThreat = target->getThreatMgr().getThreat(bot); + float botThreat = target->GetThreatMgr().getThreat(bot); float maxThreat = -1.0f; bool hasTank = false; @@ -55,7 +55,7 @@ uint8 ThreatValue::Calculate(Unit* target) if (botAI->IsTank(player)) { hasTank = true; - float threat = target->getThreatMgr().getThreat(player); + float threat = target->GetThreatMgr().getThreat(player); if (maxThreat < threat) maxThreat = threat; } diff --git a/src/strategy/warlock/DpsWarlockStrategy.cpp b/src/strategy/warlock/DpsWarlockStrategy.cpp index b5881f3d..88eedf83 100644 --- a/src/strategy/warlock/DpsWarlockStrategy.cpp +++ b/src/strategy/warlock/DpsWarlockStrategy.cpp @@ -14,7 +14,7 @@ class DpsWarlockStrategyActionNodeFactory : public NamedObjectFactory