From 07e4dec70dbec6e7c74a6aa5ce72e1b96d0d5751 Mon Sep 17 00:00:00 2001 From: Cryo81 <63260888+Cryo81@users.noreply.github.com> Date: Sun, 20 Apr 2025 03:26:42 -0300 Subject: [PATCH] Warning fix + ilvl function fix (#1210) * 1 variable order warning fixed 70 unused variable warning fixed * Fixed GetEquipGearScore function --------- Co-authored-by: Julien MAS --- src/ChatFilter.cpp | 4 +- src/FleeManager.h | 2 +- src/PlayerbotAI.cpp | 42 ++++++++++++++++--- src/PlayerbotAI.h | 3 +- src/PlayerbotMgr.cpp | 6 +-- src/PlayerbotSecurity.cpp | 8 ++-- src/RandomItemMgr.cpp | 6 +-- src/RandomPlayerbotFactory.cpp | 4 +- src/RandomPlayerbotMgr.cpp | 4 +- src/Talentspec.cpp | 6 +-- src/TravelMgr.cpp | 4 +- src/TravelNode.cpp | 20 ++++----- src/factory/PlayerbotFactory.cpp | 26 ++++++------ src/factory/StatsCollector.cpp | 4 +- src/factory/StatsWeightCalculator.cpp | 2 +- .../AutoMaintenanceOnLevelupAction.cpp | 2 +- .../actions/BattleGroundJoinAction.cpp | 8 ++-- src/strategy/actions/BattleGroundTactics.cpp | 6 +-- .../actions/CastCustomSpellAction.cpp | 2 +- src/strategy/actions/ChangeTalentsAction.cpp | 2 +- .../actions/ChooseRpgTargetAction.cpp | 10 ++--- .../actions/ChooseTravelTargetAction.cpp | 6 +-- src/strategy/actions/DebugAction.cpp | 12 +++--- src/strategy/actions/EmoteAction.cpp | 2 +- src/strategy/actions/GenericSpellActions.cpp | 6 +-- src/strategy/actions/GossipHelloAction.cpp | 2 +- src/strategy/actions/LfgActions.cpp | 2 +- src/strategy/actions/WhoAction.cpp | 2 +- src/strategy/warrior/WarriorActions.cpp | 2 +- src/strategy/warrior/WarriorTriggers.cpp | 2 +- 30 files changed, 120 insertions(+), 87 deletions(-) diff --git a/src/ChatFilter.cpp b/src/ChatFilter.cpp index 0cc6720b..e1f90608 100644 --- a/src/ChatFilter.cpp +++ b/src/ChatFilter.cpp @@ -156,7 +156,7 @@ public: return message; bool found = false; - bool isRti = false; + //bool isRti = false; //not used, shadowed by the next declaration, line marked for removal. for (std::vector::iterator i = rtis.begin(); i != rtis.end(); i++) { std::string const rti = *i; @@ -213,7 +213,7 @@ public: Player* bot = botAI->GetBot(); bool found = false; - bool isClass = false; + //bool isClass = false; //not used, shadowed by the next declaration, line marked for removal. for (std::map::iterator i = classNames.begin(); i != classNames.end(); i++) { bool isClass = message.find(i->first) == 0; diff --git a/src/FleeManager.h b/src/FleeManager.h index 1af8f7cf..22caf1f1 100644 --- a/src/FleeManager.h +++ b/src/FleeManager.h @@ -18,7 +18,7 @@ class FleePoint { public: FleePoint(PlayerbotAI* botAI, float x, float y, float z) - : botAI(botAI), sumDistance(0.0f), minDistance(0.0f), x(x), y(y), z(z) + : x(x), y(y), z(z), sumDistance(0.0f), minDistance(0.0f), botAI(botAI) { } diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index 43eb0446..fa5e4eb2 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -57,6 +57,8 @@ #include "UpdateTime.h" #include "Vehicle.h" +const int SPELL_TITAN_GRIP = 49152; + std::vector PlayerbotAI::dispel_whitelist = { "mutating injection", "frostbolt", @@ -4396,7 +4398,37 @@ void PlayerbotAI::RemoveShapeshift() // RemoveAura("tree of life"); } -uint32 PlayerbotAI::GetEquipGearScore(Player* player, bool withBags, bool withBank) +// NOTE : function rewritten as flags "withBags" and "withBank" not used, and _fillGearScoreData sometimes attribute one-hand/2H Weapon in wrong slots +uint32 PlayerbotAI::GetEquipGearScore(Player* player) +{ + //This function aims to calculate the equipped gear score + + uint32 sum = 0; + uint8 count = EQUIPMENT_SLOT_END - 2; // ignore body and tabard slots + uint8 mh_type = 0; + + for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i) + { + Item* item =player->GetItemByPos(INVENTORY_SLOT_BAG_0,i); + if (item && i != EQUIPMENT_SLOT_BODY && i != EQUIPMENT_SLOT_TABARD){ + ItemTemplate const* proto = item->GetTemplate(); + sum += proto->ItemLevel; + + //if character is not warfury and have 2 hand weapon equipped, main hand will be counted twice + if (i == SLOT_MAIN_HAND) + mh_type = item->GetTemplate()->InventoryType; + if(!player->HasSpell(SPELL_TITAN_GRIP) && mh_type == INVTYPE_2HWEAPON && i == SLOT_MAIN_HAND) + sum += item->GetTemplate()->ItemLevel; + } + + } + + uint32 gs = uint32(sum / count); + return gs; + +} + +/*uint32 PlayerbotAI::GetEquipGearScore(Player* player, bool withBags, bool withBank) { std::vector gearScore(EQUIPMENT_SLOT_END); uint32 twoHandScore = 0; @@ -4471,6 +4503,7 @@ uint32 PlayerbotAI::GetEquipGearScore(Player* player, bool withBags, bool withBa sum += gearScore[i]; } + if (count) { uint32 res = uint32(sum / count); @@ -4478,8 +4511,7 @@ uint32 PlayerbotAI::GetEquipGearScore(Player* player, bool withBags, bool withBa } return 0; -} - +}*/ uint32 PlayerbotAI::GetMixedGearScore(Player* player, bool withBags, bool withBank, uint32 topN) { std::vector gearScore(EQUIPMENT_SLOT_END); @@ -4627,7 +4659,7 @@ void PlayerbotAI::_fillGearScoreData(Player* player, Item* item, std::vectorGetCharacterAccountIdByGuid(guid); - bool isRandomBot = sRandomPlayerbotMgr->IsRandomBot(guid.GetCounter()); - bool isRandomAccount = sPlayerbotAIConfig->IsInRandomAccountList(botAccount); - bool isMasterAccount = (masterAccountId == botAccount); + //bool isRandomBot = sRandomPlayerbotMgr->IsRandomBot(guid.GetCounter()); //not used, line marked for removal. + //bool isRandomAccount = sPlayerbotAIConfig->IsInRandomAccountList(botAccount); //not used, shadowed, line marked for removal. + //bool isMasterAccount = (masterAccountId == botAccount); //not used, line marked for removal. if (cmd == "add" || cmd == "addaccount" || cmd == "login") { diff --git a/src/PlayerbotSecurity.cpp b/src/PlayerbotSecurity.cpp index 5b7638e5..66bbc13d 100644 --- a/src/PlayerbotSecurity.cpp +++ b/src/PlayerbotSecurity.cpp @@ -86,8 +86,8 @@ PlayerbotSecurityLevel PlayerbotSecurity::LevelFor(Player* from, DenyReason* rea } } - int32 botGS = (int32)botAI->GetEquipGearScore(bot, false, false); - int32 fromGS = (int32)botAI->GetEquipGearScore(from, false, false); + int32 botGS = (int32)botAI->GetEquipGearScore(bot/*, false, false*/); + int32 fromGS = (int32)botAI->GetEquipGearScore(from/*, false, false*/); if (sPlayerbotAIConfig->gearscorecheck) { if (botGS && bot->GetLevel() > 15 && botGS > fromGS && @@ -211,8 +211,8 @@ bool PlayerbotSecurity::CheckLevelFor(PlayerbotSecurityLevel level, bool silent, break; case PLAYERBOT_DENY_GEARSCORE: { - int botGS = (int)botAI->GetEquipGearScore(bot, false, false); - int fromGS = (int)botAI->GetEquipGearScore(from, false, false); + int botGS = (int)botAI->GetEquipGearScore(bot/*, false, false*/); + int fromGS = (int)botAI->GetEquipGearScore(from/*, false, false*/); int diff = (100 * (botGS - fromGS) / botGS); int req = 12 * sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) / from->GetLevel(); out << "Your gearscore is too low: |cffff0000" << fromGS << "|cffffffff/|cff00ff00" << botGS diff --git a/src/RandomItemMgr.cpp b/src/RandomItemMgr.cpp index 799c1cb3..c1e0b899 100644 --- a/src/RandomItemMgr.cpp +++ b/src/RandomItemMgr.cpp @@ -833,7 +833,7 @@ bool RandomItemMgr::CanEquipWeapon(uint8 clazz, ItemTemplate const* proto) void RandomItemMgr::BuildItemInfoCache() { - uint32 maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); + //uint32 maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); //not used, line marked for removal. // load weightscales LOG_INFO("playerbots", "Loading weightscales info"); @@ -1347,7 +1347,7 @@ uint32 RandomItemMgr::CalculateStatWeight(uint8 playerclass, uint8 spec, ItemTem // check weapon dps if (proto->IsWeaponVellum()) { - WeaponAttackType attType = BASE_ATTACK; + //WeaponAttackType attType = BASE_ATTACK; //not used, line marked for removal. uint32 dps = 0; for (uint8 i = 0; i < MAX_ITEM_PROTO_DAMAGES; i++) @@ -2206,7 +2206,7 @@ void RandomItemMgr::BuildEquipCacheNew() ObjectMgr::QuestMap const& questTemplates = sObjectMgr->GetQuestTemplates(); for (ObjectMgr::QuestMap::const_iterator i = questTemplates.begin(); i != questTemplates.end(); ++i) { - uint32 questId = i->first; + //uint32 questId = i->first; //not used in this scope, line marked for removal. Quest const* quest = i->second; if (quest->IsRepeatable()) diff --git a/src/RandomPlayerbotFactory.cpp b/src/RandomPlayerbotFactory.cpp index 41e02906..50cde2eb 100644 --- a/src/RandomPlayerbotFactory.cpp +++ b/src/RandomPlayerbotFactory.cpp @@ -225,7 +225,7 @@ Player* RandomPlayerbotFactory::CreateRandomBot(WorldSession* session, uint8 cls } } - uint8 skinColor = skinColors[urand(0, skinColors.size() - 1)]; + //uint8 skinColor = skinColors[urand(0, skinColors.size() - 1)]; //not used, line marked for removal. std::pair face = faces[urand(0, faces.size() - 1)]; std::pair hair = hairs[urand(0, hairs.size() - 1)]; @@ -408,7 +408,7 @@ uint32 RandomPlayerbotFactory::CalculateTotalAccountCount() sPlayerbotAIConfig->addClassAccountPoolSize == 0) return 0; - bool isWOTLK = sWorld->getIntConfig(CONFIG_EXPANSION) == EXPANSION_WRATH_OF_THE_LICH_KING; + //bool isWOTLK = sWorld->getIntConfig(CONFIG_EXPANSION) == EXPANSION_WRATH_OF_THE_LICH_KING; //not used, line marked for removal. // Determine divisor based on WOTLK condition int divisor = CalculateAvailableCharsPerAccount(); diff --git a/src/RandomPlayerbotMgr.cpp b/src/RandomPlayerbotMgr.cpp index fb2167a4..a4d973dc 100644 --- a/src/RandomPlayerbotMgr.cpp +++ b/src/RandomPlayerbotMgr.cpp @@ -2671,7 +2671,7 @@ void RandomPlayerbotMgr::OnPlayerLogin(Player* player) if (IsRandomBot(player)) { - ObjectGuid::LowType guid = player->GetGUID().GetCounter(); + //ObjectGuid::LowType guid = player->GetGUID().GetCounter(); //not used, conditional could be rewritten for simplicity. line marked for removal. } else { @@ -2729,7 +2729,7 @@ void RandomPlayerbotMgr::PrintStats() uint32 changeStrategy = 0; uint32 dead = 0; uint32 combat = 0; - uint32 revive = 0; + //uint32 revive = 0; //not used, line marked for removal. uint32 taxi = 0; uint32 moving = 0; uint32 mounted = 0; diff --git a/src/Talentspec.cpp b/src/Talentspec.cpp index 39a75702..aa22ae5e 100644 --- a/src/Talentspec.cpp +++ b/src/Talentspec.cpp @@ -260,7 +260,7 @@ void TalentSpec::ReadTalents(Player* bot) // Set the talent ranks to the ranks of the link. void TalentSpec::ReadTalents(std::string const link) { - uint32 rank = 0; + //uint32 rank = 0; //not used, line marked for removal. uint32 pos = 0; uint32 tab = 0; std::string chr; @@ -397,7 +397,7 @@ uint32 TalentSpec::highestTree() std::string const TalentSpec::FormatSpec(Player* bot) { - uint8 cls = bot->getClass(); + // uint8 cls = bot->getClass(); //not used, (used in lined 403), line marked for removal. std::ostringstream out; // out << chathelper:: specs[cls][highestTree()] << " ("; @@ -468,7 +468,7 @@ bool TalentSpec::isEarlierVersionOf(TalentSpec& newSpec) // Modifies current talents towards new talents up to a maxium of points. void TalentSpec::ShiftTalents(TalentSpec* currentSpec, uint32 level) { - uint32 currentPoints = currentSpec->GetTalentPoints(); + //uint32 currentPoints = currentSpec->GetTalentPoints(); //not used, line marked for removal. if (points >= LeveltoPoints(level)) // We have no more points to spend. Better reset and crop { CropTalents(level); diff --git a/src/TravelMgr.cpp b/src/TravelMgr.cpp index 14555078..def180ee 100644 --- a/src/TravelMgr.cpp +++ b/src/TravelMgr.cpp @@ -644,7 +644,7 @@ void WorldPosition::loadMapAndVMap(uint32 mapId, uint8 x, uint8 y) { // load VMAPs for current map/grid... const MapEntry* i_mapEntry = sMapStore.LookupEntry(mapId); - const char* mapName = i_mapEntry ? i_mapEntry->name[sWorld->GetDefaultDbcLocale()] : "UNNAMEDMAP\x0"; + //const char* mapName = i_mapEntry ? i_mapEntry->name[sWorld->GetDefaultDbcLocale()] : "UNNAMEDMAP\x0"; //not used, (usage are commented out below), line marked for removal. int vmapLoadResult = VMAP::VMapFactory::createOrGetVMapMgr()->loadMap( (sWorld->GetDataPath() + "vmaps").c_str(), mapId, x, y); @@ -1103,7 +1103,7 @@ bool QuestRelationTravelDestination::isActive(Player* bot) if (!bot->GetMap()->GetEntry()->IsWorldMap() || !bot->CanTakeQuest(questTemplate, false)) return false; - uint32 dialogStatus = sTravelMgr->getDialogStatus(bot, entry, questTemplate); + //uint32 dialogStatus = sTravelMgr->getDialogStatus(bot, entry, questTemplate); //not used, shadowed by the next declaration, line marked for removal. if (AI_VALUE(bool, "can fight equal")) { diff --git a/src/TravelNode.cpp b/src/TravelNode.cpp index 0acddeb7..6447818c 100644 --- a/src/TravelNode.cpp +++ b/src/TravelNode.cpp @@ -594,7 +594,7 @@ bool TravelNode::isEqual(TravelNode* compareNode) void TravelNode::print([[maybe_unused]] bool printFailed) { - WorldPosition* startPosition = getPosition(); + // WorldPosition* startPosition = getPosition(); //not used, line marked for removal. uint32 mapSize = getNodeMap(true).size(); @@ -1167,9 +1167,9 @@ std::vector TravelNodeMap::getNodes(WorldPosition pos, float range) TravelNode* TravelNodeMap::getNode(WorldPosition pos, [[maybe_unused]] std::vector& ppath, Unit* bot, float range) { - float x = pos.getX(); - float y = pos.getY(); - float z = pos.getZ(); + //float x = pos.getX(); //not used, line marked for removal. + //float y = pos.getY(); //not used, line marked for removal. + //float z = pos.getZ(); //not used, line marked for removal. if (bot && !bot->GetMap()) return nullptr; @@ -1495,7 +1495,7 @@ TravelNode* TravelNodeMap::addZoneLinkNode(TravelNode* startNode) { for (auto& path : *startNode->getPaths()) { - TravelNode* endNode = path.first; + //TravelNode* endNode = path.first; //not used, line marked for removal. std::string zoneName = startNode->getPosition()->getAreaName(true, true); for (auto& pos : path.second.getPath()) @@ -1638,7 +1638,7 @@ void TravelNodeMap::generateNpcNodes() else if (cInfo->npcflag & UNIT_NPC_FLAG_SPIRITGUIDE) nodeName += " spiritguide"; - TravelNode* node = sTravelNodeMap->addNode(guidP, nodeName, true, true); + /*TravelNode* node = */ sTravelNodeMap->addNode(guidP, nodeName, true, true); //node not used, fragment marked for removal. } else if (cInfo->rank == 3) { @@ -1754,7 +1754,7 @@ void TravelNodeMap::generateAreaTriggerNodes() else nodeName = inPos.getAreaName(false) + " portal"; - TravelNode* entryNode = sTravelNodeMap->getNode(outPos, nullptr, 20.0f); // Entry side, portal exit. + //TravelNode* entryNode = sTravelNodeMap->getNode(outPos, nullptr, 20.0f); // Entry side, portal exit. //not used, line marked for removal. TravelNode* outNode = sTravelNodeMap->addNode(outPos, nodeName, true, true); // Exit size, portal exit. @@ -1976,7 +1976,7 @@ void TravelNodeMap::generateZoneMeanNodes() WorldPosition pos = WorldPosition(points, WP_MEAN_CENTROID); - TravelNode* node = sTravelNodeMap->addNode(pos, pos.getAreaName(), true, true, false); + /*TravelNode* node = */sTravelNodeMap->addNode(pos, pos.getAreaName(), true, true, false); //node not used, but addNode as side effect, fragment marked for removal. } } @@ -2117,7 +2117,7 @@ void TravelNodeMap::removeUselessPaths() if (path.second.getComplete() && startNode->hasLinkTo(path.first)) ASSERT(true); } - uint32 it = 0, rem = 0; + uint32 it = 0/*, rem = 0*/; //rem not used in this scope, (shadowing) fragment marked for removal. while (true) { uint32 rem = 0; @@ -2207,7 +2207,7 @@ void TravelNodeMap::printMap() std::vector anodes = getNodes(); - uint32 nr = 0; + //uint32 nr = 0; //not used, line marked for removal. for (auto& node : anodes) { diff --git a/src/factory/PlayerbotFactory.cpp b/src/factory/PlayerbotFactory.cpp index 786cbb2e..d8be6ff9 100644 --- a/src/factory/PlayerbotFactory.cpp +++ b/src/factory/PlayerbotFactory.cpp @@ -129,7 +129,7 @@ void PlayerbotFactory::Init() if (!spellInfo) continue; - uint32 requiredLevel = spellInfo->BaseLevel; + //uint32 requiredLevel = spellInfo->BaseLevel; //not used, line marked for removal. for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) { @@ -970,7 +970,7 @@ void PlayerbotFactory::ClearSpells() for (PlayerSpellMap::iterator itr = bot->GetSpellMap().begin(); itr != bot->GetSpellMap().end(); ++itr) { uint32 spellId = itr->first; - const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(spellId); + //const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(spellId); //not used, line marked for removal. if (itr->second->State == PLAYERSPELL_REMOVED) { continue; @@ -2197,7 +2197,7 @@ void PlayerbotFactory::UpdateTradeSkills() void PlayerbotFactory::InitSkills() { - uint32 maxValue = level * 5; + //uint32 maxValue = level * 5; //not used, line marked for removal. bot->UpdateSkillsForLevel(); bot->SetSkill(SKILL_RIDING, 0, 0, 0); @@ -2354,7 +2354,7 @@ void PlayerbotFactory::SetRandomSkill(uint16 id) // uint32 value = urand(maxValue - level, maxValue); uint32 value = maxValue; - uint32 curValue = bot->GetSkillValue(id); + //uint32 curValue = bot->GetSkillValue(id); //not used, line marked for removal. uint16 step = bot->GetSkillValue(id) ? bot->GetSkillStep(id) : 1; @@ -3324,7 +3324,7 @@ void PlayerbotFactory::InitGlyphs(bool increment) ItemTemplateContainer const* itemTemplates = sObjectMgr->GetItemTemplateStore(); for (ItemTemplateContainer::const_iterator i = itemTemplates->begin(); i != itemTemplates->end(); ++i) { - uint32 itemId = i->first; + //uint32 itemId = i->first; //not used, line marked for removal. ItemTemplate const* proto = &i->second; if (!proto) continue; @@ -3424,9 +3424,9 @@ void PlayerbotFactory::InitGlyphs(bool increment) ids.push_back(id); } - int maxCount = urand(0, 3); - int count = 0; - bool found = false; + //int maxCount = urand(0, 3); //not used, line marked for removal. + //int count = 0; //not used, line marked for removal. + //bool found = false; //not used, line marked for removal. for (int attempts = 0; attempts < 15; ++attempts) { uint32 index = urand(0, ids.size() - 1); @@ -3444,7 +3444,7 @@ void PlayerbotFactory::InitGlyphs(bool increment) ~(TRIGGERED_IGNORE_SHAPESHIFT | TRIGGERED_IGNORE_CASTER_AURASTATE))); bot->SetGlyph(realSlot, id, true); - found = true; + //found = true; //not used, line marked for removal. break; } } @@ -3491,7 +3491,7 @@ void PlayerbotFactory::InitInventorySkill() Item* PlayerbotFactory::StoreItem(uint32 itemId, uint32 count) { - ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId); + //ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId); //not used, line marked for removal. ItemPosCountVec sDest; InventoryResult msg = bot->CanStoreNewItem(INVENTORY_SLOT_BAG_0, NULL_SLOT, sDest, itemId, count); if (msg != EQUIP_ERR_OK) @@ -3914,8 +3914,8 @@ void PlayerbotFactory::ApplyEnchantTemplate(uint8 spec) void PlayerbotFactory::ApplyEnchantAndGemsNew(bool destoryOld) { - int32 bestGemEnchantId[4] = {-1, -1, -1, -1}; // 1, 2, 4, 8 color - float bestGemScore[4] = {0, 0, 0, 0}; + //int32 bestGemEnchantId[4] = {-1, -1, -1, -1}; // 1, 2, 4, 8 color //not used, line marked for removal. + //float bestGemScore[4] = {0, 0, 0, 0}; //not used, line marked for removal. std::vector curCount = GetCurrentGemsCount(); uint8 jewelersCount = 0; int requiredActive = 2; @@ -4074,7 +4074,7 @@ void PlayerbotFactory::ApplyEnchantAndGemsNew(bool destoryOld) if (!enchant_id) continue; - SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); + //SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); //not used, line marked for removal. StatsWeightCalculator calculator(bot); float score = calculator.CalculateEnchant(enchant_id); if (curCount[0] != 0) diff --git a/src/factory/StatsCollector.cpp b/src/factory/StatsCollector.cpp index 957ea809..9a562b9a 100644 --- a/src/factory/StatsCollector.cpp +++ b/src/factory/StatsCollector.cpp @@ -744,7 +744,7 @@ void StatsCollector::HandleApplyAura(const SpellEffectInfo& effectInfo, float mu int32 StatsCollector::AverageValue(const SpellEffectInfo& effectInfo) { - float basePointsPerLevel = effectInfo.RealPointsPerLevel; + //float basePointsPerLevel = effectInfo.RealPointsPerLevel; //not used, line marked for removal. int32 basePoints = effectInfo.BasePoints; int32 randomPoints = int32(effectInfo.DieSides); @@ -830,4 +830,4 @@ bool StatsCollector::CheckSpellValidation(uint32 spellFamilyName, flag96 spelFal } return true; -} \ No newline at end of file +} diff --git a/src/factory/StatsWeightCalculator.cpp b/src/factory/StatsWeightCalculator.cpp index 7a747e6a..255fa89d 100644 --- a/src/factory/StatsWeightCalculator.cpp +++ b/src/factory/StatsWeightCalculator.cpp @@ -657,7 +657,7 @@ void StatsWeightCalculator::ApplyWeightFinetune(Player* player) { if (type_ & (CollectorType::MELEE | CollectorType::RANGED)) { - float armor_penetration_current, armor_penetration_overflow; + float armor_penetration_current/*, armor_penetration_overflow*/; //not used, line marked for removal. armor_penetration_current = player->GetRatingBonusValue(CR_ARMOR_PENETRATION); if (armor_penetration_current > 50) stats_weights_[STATS_TYPE_ARMOR_PENETRATION] *= 1.2f; diff --git a/src/strategy/actions/AutoMaintenanceOnLevelupAction.cpp b/src/strategy/actions/AutoMaintenanceOnLevelupAction.cpp index 12fcf3d5..c50e2e25 100644 --- a/src/strategy/actions/AutoMaintenanceOnLevelupAction.cpp +++ b/src/strategy/actions/AutoMaintenanceOnLevelupAction.cpp @@ -87,7 +87,7 @@ void AutoMaintenanceOnLevelupAction::LearnQuestSpells(std::ostringstream* out) ObjectMgr::QuestMap const& questTemplates = sObjectMgr->GetQuestTemplates(); for (ObjectMgr::QuestMap::const_iterator i = questTemplates.begin(); i != questTemplates.end(); ++i) { - uint32 questId = i->first; + //uint32 questId = i->first; //not used, line marked for removal. Quest const* quest = i->second; if (!quest->GetRequiredClasses() || quest->IsRepeatable() || quest->GetMinLevel() < 10) diff --git a/src/strategy/actions/BattleGroundJoinAction.cpp b/src/strategy/actions/BattleGroundJoinAction.cpp index 1bc71fe1..99f7973a 100644 --- a/src/strategy/actions/BattleGroundJoinAction.cpp +++ b/src/strategy/actions/BattleGroundJoinAction.cpp @@ -424,7 +424,7 @@ bool BGJoinAction::JoinQueue(uint32 type) uint32 bgTypeId_ = bgTypeId; uint32 instanceId = 0; // 0 = First Available - bool isPremade = false; + // bool isPremade = false; //not used, line marked for removal. bool isArena = false; bool isRated = false; uint8 arenaslot = 0; @@ -454,7 +454,7 @@ bool BGJoinAction::JoinQueue(uint32 type) bool joinAsGroup = bot->GetGroup() && bot->GetGroup()->GetLeaderGUID() == bot->GetGUID(); // in wotlk only arena requires battlemaster guid - ObjectGuid guid = isArena ? unit->GetGUID() : bot->GetGUID(); + // ObjectGuid guid = isArena ? unit->GetGUID() : bot->GetGUID(); //not used, line marked for removal. switch (bgTypeId) { @@ -874,7 +874,7 @@ bool BGStatusAction::Execute(Event event) break; } - TeamId teamId = bot->GetTeamId(); + //TeamId teamId = bot->GetTeamId(); //not used, line marked for removal. if (Time1 == TIME_TO_AUTOREMOVE) // Battleground is over, bot needs to leave { @@ -956,7 +956,7 @@ bool BGStatusAction::Execute(Event event) if (leaveQ && ((bot->GetGroup() && bot->GetGroup()->IsLeader(bot->GetGUID())) || !(bot->GetGroup() || botAI->GetMaster()))) { - TeamId teamId = bot->GetTeamId(); + //TeamId teamId = bot->GetTeamId(); //not used, line marked for removal. bool realPlayers = false; if (isRated) realPlayers = sRandomPlayerbotMgr->BattlegroundData[queueTypeId][bracketId].ratedArenaPlayerCount > 0; diff --git a/src/strategy/actions/BattleGroundTactics.cpp b/src/strategy/actions/BattleGroundTactics.cpp index 452031eb..c7d09cde 100644 --- a/src/strategy/actions/BattleGroundTactics.cpp +++ b/src/strategy/actions/BattleGroundTactics.cpp @@ -3020,7 +3020,7 @@ bool BGTactics::selectObjective(bool reset) std::vector objectives; for (uint8 i = 0; i < 3; ++i) { - WorldObject* pAttackObjectiveObject = nullptr; + // WorldObject* pAttackObjectiveObject = nullptr; //not used, line marked for removal. float attackObjectiveDistance = FLT_MAX; for (auto const& objective : AB_AttackObjectives) @@ -3071,7 +3071,7 @@ bool BGTactics::selectObjective(bool reset) std::vector objectives; for (auto i = 0; i < 3; ++i) { - WorldObject* pAttackObjectiveObject = nullptr; + //WorldObject* pAttackObjectiveObject = nullptr; //not used, line marked for removal. float attackObjectiveDistance = FLT_MAX; for (const auto& objective : AB_AttackObjectives) @@ -3755,7 +3755,7 @@ bool BGTactics::selectObjectiveWp(std::vector const& vPaths) if (bgType == BATTLEGROUND_RB) bgType = bg->GetBgTypeID(true); - PositionMap& posMap = context->GetValue("position")->Get(); + // PositionMap& posMap = context->GetValue("position")->Get(); //not used, line marked for removal. PositionInfo pos = context->GetValue("position")->Get()["bg objective"]; if (!pos.isSet()) return false; diff --git a/src/strategy/actions/CastCustomSpellAction.cpp b/src/strategy/actions/CastCustomSpellAction.cpp index 5213d1e7..e2bac818 100644 --- a/src/strategy/actions/CastCustomSpellAction.cpp +++ b/src/strategy/actions/CastCustomSpellAction.cpp @@ -262,7 +262,7 @@ bool CastRandomSpellAction::Execute(Event event) if (spellList.empty()) return false; - bool isCast = false; + // bool isCast = false; //not used, line marked for removal. std::sort(spellList.begin(), spellList.end(), [](std::pair> i, diff --git a/src/strategy/actions/ChangeTalentsAction.cpp b/src/strategy/actions/ChangeTalentsAction.cpp index 26fc1067..25d3ed30 100644 --- a/src/strategy/actions/ChangeTalentsAction.cpp +++ b/src/strategy/actions/ChangeTalentsAction.cpp @@ -125,7 +125,7 @@ std::string ChangeTalentsAction::SpecList() std::string ChangeTalentsAction::SpecPick(std::string param) { int cls = bot->getClass(); - int specFound = 0; + // int specFound = 0; //not used, line marked for removal. for (int specNo = 0; specNo < MAX_SPECNO; ++specNo) { if (sPlayerbotAIConfig->premadeSpecName[cls][specNo].size() == 0) diff --git a/src/strategy/actions/ChooseRpgTargetAction.cpp b/src/strategy/actions/ChooseRpgTargetAction.cpp index 4b00cfe5..2422f1e0 100644 --- a/src/strategy/actions/ChooseRpgTargetAction.cpp +++ b/src/strategy/actions/ChooseRpgTargetAction.cpp @@ -117,19 +117,19 @@ float ChooseRpgTargetAction::getMaxRelevance(GuidPosition guidP) bool ChooseRpgTargetAction::Execute(Event event) { - TravelTarget* travelTarget = AI_VALUE(TravelTarget*, "travel target"); + //TravelTarget* travelTarget = AI_VALUE(TravelTarget*, "travel target"); //not used, line marked for removal. Player* master = botAI->GetMaster(); GuidPosition masterRpgTarget; if (master && master != bot && GET_PLAYERBOT_AI(master) && master->GetMapId() == bot->GetMapId() && !master->IsBeingTeleported()) { Player* player = botAI->GetMaster(); - GuidPosition masterRpgTarget = PAI_VALUE(GuidPosition, "rpg target"); + //GuidPosition masterRpgTarget = PAI_VALUE(GuidPosition, "rpg target"); //not used, line marked for removal. } else master = nullptr; std::unordered_map targets; - uint32 num = 0; + // uint32 num = 0; //not used, line marked for removal. GuidVector possibleTargets = AI_VALUE(GuidVector, "possible rpg targets"); GuidVector possibleObjects = AI_VALUE(GuidVector, "nearest game objects no los"); GuidVector possiblePlayers = AI_VALUE(GuidVector, "nearest friendly players"); @@ -169,7 +169,7 @@ bool ChooseRpgTargetAction::Execute(Event event) if (!guidP || !guidP.getMap()) continue; - float priority = 1; + // float priority = 1; //not used, line marked for removal. if (guidP.GetWorldObject() && !isFollowValid(bot, guidP.GetWorldObject())) continue; @@ -285,7 +285,7 @@ bool ChooseRpgTargetAction::isUseful() if (guidP && guidP.distance(bot) < sPlayerbotAIConfig->reactDistance * 2) return false; - TravelTarget* travelTarget = AI_VALUE(TravelTarget*, "travel target"); + // TravelTarget* travelTarget = AI_VALUE(TravelTarget*, "travel target"); //not used, line marked for removal. //if (travelTarget->isTraveling() && AI_VALUE2(bool, "can free move to", *travelTarget->getPosition())) //return false; diff --git a/src/strategy/actions/ChooseTravelTargetAction.cpp b/src/strategy/actions/ChooseTravelTargetAction.cpp index ed0aaf8d..8c7bc6c9 100644 --- a/src/strategy/actions/ChooseTravelTargetAction.cpp +++ b/src/strategy/actions/ChooseTravelTargetAction.cpp @@ -11,7 +11,7 @@ bool ChooseTravelTargetAction::Execute(Event event) { - Player* requester = event.getOwner() ? event.getOwner() : GetMaster(); + // Player* requester = event.getOwner() ? event.getOwner() : GetMaster(); //not used, line marked for removal. //Get the current travel target. This target is no longer active. TravelTarget* oldTarget = context->GetValue("travel target")->Get(); @@ -501,7 +501,7 @@ bool ChooseTravelTargetAction::SetQuestTarget(TravelTarget* target, bool onlyCom continue; uint32 questId = quest.first; - QuestStatusData* questStatus = &quest.second; + // QuestStatusData* questStatus = &quest.second; //not used, line marked for removal. const auto questTemplate = sObjectMgr->GetQuestTemplate(questId); if (!activeQuests && !bot->CanRewardQuest(questTemplate, false)) @@ -826,7 +826,7 @@ TravelDestination* ChooseTravelTargetAction::FindDestination(Player* bot, std::s { PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot); - AiObjectContext* context = botAI->GetAiObjectContext(); + // AiObjectContext* context = botAI->GetAiObjectContext(); //not used, line marked for removal. std::vector dests; diff --git a/src/strategy/actions/DebugAction.cpp b/src/strategy/actions/DebugAction.cpp index 6e3791a8..0c2cbac1 100644 --- a/src/strategy/actions/DebugAction.cpp +++ b/src/strategy/actions/DebugAction.cpp @@ -162,7 +162,7 @@ bool DebugAction::Execute(Event event) std::ostringstream out; out << "bad quests:"; - uint32 noT = 0, noG = 0, noO = 0; + // uint32 noT = 0, noG = 0, noO = 0; //not used, line marked for removal. for (auto q : sTravelMgr->quests) { @@ -194,7 +194,7 @@ bool DebugAction::Execute(Event event) std::string const name = "USER:" + text.substr(9); - TravelNode* startNode = sTravelNodeMap->addNode(pos, name, false, false); + /* TravelNode* startNode = */ sTravelNodeMap->addNode(pos, name, false, false); // startNode not used, but addNode as side effect, fragment marked for removal. for (auto& endNode : sTravelNodeMap->getNodes(pos, 2000)) { @@ -291,7 +291,7 @@ bool DebugAction::Execute(Event event) Unit* start = nullptr; GuidVector units; - uint32 time = 60 * IN_MILLISECONDS; + // uint32 time = 60 * IN_MILLISECONDS; //not used, line marked for removal. std::vector ppath = l.second->getPath(); @@ -342,7 +342,7 @@ bool DebugAction::Execute(Event event) { uint32 spellEffect = stoi(text.substr(7)); - Unit* prev = bot; + // Unit* prev = bot; //not used, line marked for removal. for (float i = 0; i < 60; i++) { @@ -373,7 +373,7 @@ bool DebugAction::Execute(Event event) { uint32 spellEffect = stoi(text.substr(7)); - Unit* prev = bot; + // Unit* prev = bot; //not used, line marked for removal. for (float i = 0; i < 60; i++) { @@ -815,7 +815,7 @@ bool DebugAction::Execute(Event event) uint32 i = dx + dy * 10; GuidVector hits, miss; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(effect); + // SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(effect); //not used, line marked for removal. for (auto tar : all_targets) { // hits.push_back(tar); diff --git a/src/strategy/actions/EmoteAction.cpp b/src/strategy/actions/EmoteAction.cpp index 57e7ffb6..ba44424b 100644 --- a/src/strategy/actions/EmoteAction.cpp +++ b/src/strategy/actions/EmoteAction.cpp @@ -734,7 +734,7 @@ bool EmoteAction::Execute(Event event) std::string param = event.getParam(); if ((!isReact && param.empty()) || emote) { - time_t lastEmote = AI_VALUE2(time_t, "last emote", qualifier); + // time_t lastEmote = AI_VALUE2(time_t, "last emote", qualifier); //not used, line marked for removal. botAI->GetAiObjectContext() ->GetValue("last emote", qualifier) ->Set(time(nullptr) + urand(1000, sPlayerbotAIConfig->repeatDelay) / 1000); diff --git a/src/strategy/actions/GenericSpellActions.cpp b/src/strategy/actions/GenericSpellActions.cpp index 749bed14..3ac2a7e4 100644 --- a/src/strategy/actions/GenericSpellActions.cpp +++ b/src/strategy/actions/GenericSpellActions.cpp @@ -92,7 +92,7 @@ bool CastSpellAction::isPossible() return false; } - Spell* currentSpell = bot->GetCurrentSpell(CURRENT_GENERIC_SPELL); + // Spell* currentSpell = bot->GetCurrentSpell(CURRENT_GENERIC_SPELL); //not used, line marked for removal. return botAI->CanCastSpell(spell, GetTarget()); } @@ -321,7 +321,7 @@ bool UseTrinketAction::UseTrinket(Item* item) uint8 bagIndex = item->GetBagSlot(); uint8 slot = item->GetSlot(); - uint8 spell_index = 0; + // uint8 spell_index = 0; //not used, line marked for removal. uint8 cast_count = 1; ObjectGuid item_guid = item->GetGUID(); uint32 glyphIndex = 0; @@ -371,4 +371,4 @@ bool CastDebuffSpellAction::isUseful() } return CastAuraSpellAction::isUseful() && (target->GetHealth() / AI_VALUE(float, "estimated group dps")) >= needLifeTime; -} \ No newline at end of file +} diff --git a/src/strategy/actions/GossipHelloAction.cpp b/src/strategy/actions/GossipHelloAction.cpp index 0a10541d..762b82b8 100644 --- a/src/strategy/actions/GossipHelloAction.cpp +++ b/src/strategy/actions/GossipHelloAction.cpp @@ -129,7 +129,7 @@ bool GossipHelloAction::ProcessGossip(int32 menuToSelect) return false; } - GossipMenuItem const* item = menu.GetItem(menuToSelect); + // GossipMenuItem const* item = menu.GetItem(menuToSelect); //not used, line marked for removal. WorldPacket p; std::string code; p << GetMaster()->GetTarget(); diff --git a/src/strategy/actions/LfgActions.cpp b/src/strategy/actions/LfgActions.cpp index 61687eec..d4029c18 100644 --- a/src/strategy/actions/LfgActions.cpp +++ b/src/strategy/actions/LfgActions.cpp @@ -150,7 +150,7 @@ bool LfgJoinAction::JoinLFG() many ? "several dungeons" : dungeon->Name[0]); // Set RbotAId Browser comment - std::string const _gs = std::to_string(botAI->GetEquipGearScore(bot, false, false)); + std::string const _gs = std::to_string(botAI->GetEquipGearScore(bot/*, false, false*/)); // JoinLfg is not threadsafe, so make packet and queue into session // sLFGMgr->JoinLfg(bot, roleMask, list, _gs); diff --git a/src/strategy/actions/WhoAction.cpp b/src/strategy/actions/WhoAction.cpp index 25606c4f..78535600 100644 --- a/src/strategy/actions/WhoAction.cpp +++ b/src/strategy/actions/WhoAction.cpp @@ -117,7 +117,7 @@ std::string const WhoAction::QuerySpec(std::string const text) out << "|h|cffffffff" << chat->FormatRace(bot->getRace()) << " [" << (bot->getGender() == GENDER_MALE ? "M" : "F") << "] " << chat->FormatClass(bot, spec); out << " (|h|cff00ff00" << (uint32)bot->GetLevel() << "|h|cffffffff lvl), "; - out << "|h|cff00ff00" << botAI->GetEquipGearScore(bot, false, false) << "|h|cffffffff GS ("; + out << "|h|cff00ff00" << botAI->GetEquipGearScore(bot/*, false, false*/) << "|h|cffffffff GS ("; ItemCountByQuality visitor; IterateItems(&visitor, ITERATE_ITEMS_IN_EQUIP); diff --git a/src/strategy/warrior/WarriorActions.cpp b/src/strategy/warrior/WarriorActions.cpp index a6eee7dc..4bff0686 100644 --- a/src/strategy/warrior/WarriorActions.cpp +++ b/src/strategy/warrior/WarriorActions.cpp @@ -58,7 +58,7 @@ Unit* CastVigilanceAction::GetTarget() } // Determine Highest Gear Score - uint32 gearScore = botAI->GetEquipGearScore(member, false, false); + uint32 gearScore = botAI->GetEquipGearScore(member/*, false, false*/); if (gearScore > highestGearScore) { highestGearScore = gearScore; diff --git a/src/strategy/warrior/WarriorTriggers.cpp b/src/strategy/warrior/WarriorTriggers.cpp index 75afb373..61863d85 100644 --- a/src/strategy/warrior/WarriorTriggers.cpp +++ b/src/strategy/warrior/WarriorTriggers.cpp @@ -63,7 +63,7 @@ bool VigilanceTrigger::IsActive() } // Determine Highest Gear Score - uint32 gearScore = botAI->GetEquipGearScore(member, false, false); + uint32 gearScore = botAI->GetEquipGearScore(member/*, false, false*/); if (gearScore > highestGearScore) { highestGearScore = gearScore;