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

@@ -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;
@@ -371,4 +371,4 @@ bool CastDebuffSpellAction::isUseful()
}
return CastAuraSpellAction::isUseful() &&
(target->GetHealth() / AI_VALUE(float, "estimated group dps")) >= needLifeTime;
}
}

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;