Warning fix + ilvl function fix (#1210)

* 1 variable order warning fixed
70 unused variable warning fixed

* Fixed GetEquipGearScore function

---------

Co-authored-by: Julien MAS <julien.mas81@gmail.com>
This commit is contained in:
Cryo81
2025-04-20 03:26:42 -03:00
committed by GitHub
parent eb3fa56829
commit 07e4dec70d
30 changed files with 120 additions and 87 deletions

View File

@@ -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<std::string>::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<std::string, uint8>::iterator i = classNames.begin(); i != classNames.end(); i++)
{
bool isClass = message.find(i->first) == 0;

View File

@@ -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)
{
}

View File

@@ -57,6 +57,8 @@
#include "UpdateTime.h"
#include "Vehicle.h"
const int SPELL_TITAN_GRIP = 49152;
std::vector<std::string> 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<uint32> 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<uint32> gearScore(EQUIPMENT_SLOT_END);
@@ -4627,7 +4659,7 @@ void PlayerbotAI::_fillGearScoreData(Player* player, Item* item, std::vector<uin
case INVTYPE_SHOULDERS:
(*gearScore)[EQUIPMENT_SLOT_SHOULDERS] = std::max((*gearScore)[EQUIPMENT_SLOT_SHOULDERS], level);
break;
case INVTYPE_BODY:
case INVTYPE_BODY: //Shouldn't be considered when calculating average ilevel
(*gearScore)[EQUIPMENT_SLOT_BODY] = std::max((*gearScore)[EQUIPMENT_SLOT_BODY], level);
break;
case INVTYPE_CHEST:
@@ -4646,7 +4678,7 @@ void PlayerbotAI::_fillGearScoreData(Player* player, Item* item, std::vector<uin
(*gearScore)[EQUIPMENT_SLOT_WRISTS] = std::max((*gearScore)[EQUIPMENT_SLOT_WRISTS], level);
break;
case INVTYPE_HANDS:
(*gearScore)[EQUIPMENT_SLOT_HEAD] = std::max((*gearScore)[EQUIPMENT_SLOT_HEAD], level);
(*gearScore)[EQUIPMENT_SLOT_HANDS] = std::max((*gearScore)[EQUIPMENT_SLOT_HANDS], level);
break;
// equipped gear score check uses both rings and trinkets for calculation, assume that for bags/banks it is the
// same with keeping second highest score at second slot

View File

@@ -509,7 +509,8 @@ public:
bool IsInVehicle(bool canControl = false, bool canCast = false, bool canAttack = false, bool canTurn = false,
bool fixed = false);
uint32 GetEquipGearScore(Player* player, bool withBags, bool withBank);
uint32 GetEquipGearScore(Player* player);
//uint32 GetEquipGearScore(Player* player, bool withBags, bool withBank);
static uint32 GetMixedGearScore(Player* player, bool withBags, bool withBank, uint32 topN = 0);
bool HasSkill(SkillType skill);
bool IsAllowedCommand(std::string const text);

View File

@@ -629,9 +629,9 @@ std::string const PlayerbotHolder::ProcessBotCommand(std::string const cmd, Obje
return "bot system is disabled";
uint32 botAccount = sCharacterCache->GetCharacterAccountIdByGuid(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")
{

View File

@@ -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

View File

@@ -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())

View File

@@ -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<uint8, uint8> face = faces[urand(0, faces.size() - 1)];
std::pair<uint8, uint8> 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();

View File

@@ -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;

View File

@@ -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);

View File

@@ -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"))
{

View File

@@ -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<TravelNode*> TravelNodeMap::getNodes(WorldPosition pos, float range)
TravelNode* TravelNodeMap::getNode(WorldPosition pos, [[maybe_unused]] std::vector<WorldPosition>& 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<TravelNode*> anodes = getNodes();
uint32 nr = 0;
//uint32 nr = 0; //not used, line marked for removal.
for (auto& node : anodes)
{

View File

@@ -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<uint32> 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)

View File

@@ -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);

View File

@@ -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;

View File

@@ -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)

View File

@@ -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;

View File

@@ -3020,7 +3020,7 @@ bool BGTactics::selectObjective(bool reset)
std::vector<GameObject*> 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<GameObject*> 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<BattleBotPath*> const& vPaths)
if (bgType == BATTLEGROUND_RB)
bgType = bg->GetBgTypeID(true);
PositionMap& posMap = context->GetValue<PositionMap&>("position")->Get();
// PositionMap& posMap = context->GetValue<PositionMap&>("position")->Get(); //not used, line marked for removal.
PositionInfo pos = context->GetValue<PositionMap&>("position")->Get()["bg objective"];
if (!pos.isSet())
return false;

View File

@@ -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<uint32, std::pair<uint32, WorldObject*>> i,

View File

@@ -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)

View File

@@ -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<ObjectGuid, uint32> 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;

View File

@@ -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<TravelTarget*>("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<TravelDestination*> dests;

View File

@@ -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<WorldPosition> 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);

View File

@@ -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<time_t>("last emote", qualifier)
->Set(time(nullptr) + urand(1000, sPlayerbotAIConfig->repeatDelay) / 1000);

View File

@@ -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;

View File

@@ -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();

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;