Skip to content

Commit c925de9

Browse files
fix: Resolved all warnings. (#5)
* fix: Resolved a warning in NextAction constructor. * fix: Resolved a wrong type comparison in MovementActions.h. * fix: Resolved a unused parameter warning in AddLootAction.cpp. * fix: Resolved a unused parameter warning in AreaTriggerAction.cpp. * fix: Resolved several wrong type comparisons in PlayerbotAIConfig.cpp. * fix: Resolved a unused parameter warning in AutoMaintenanceOnLevelupAction.cpp. * fix: Resolved a unused parameter warning in ItemCountValue.cpp. * fix: Resolved a unused parameter warning in BankAction.cpp. * fix: Resolved a unused parameter warning in BossAuraActions.cpp. * fix: Resolved all warnings in BattleGroundJoinAction.cpp. * fix: Resolved an implicit default copy constructor warning in PositionValue.h. * fix: Resolved a unused parameter warning in CancelChannelAction.cpp. * fix: Resolved a unused parameter warning in CastCustomSpellAction.h. * fix: Resolved a unused parameter warning in CastCustomSpellAction.cpp. * fix: Resolved all but one warning in BattleGroundTactics.cpp. * fix: Resolved all warnings within ChatShortcutActions.cpp. * fix: Resolved an unused parameter warning in ChangeTalentsAction.cpp. * fix: Resolved an unused parameter warning in CheckMailAction.cpp. * fix: Resolved an unused parameter warning in CheckValuesAction.cpp. * fix: Resolved an unused parameter warning in ChooseTargetActions.cpp. * fix: Resolved all warnings within ChooseRpgTargetAction.cpp. * fix: Refactored horrible code in AttackAnythingAction::Execute. * fix: Resolved an unused parameter warning with DelayAction.cpp. * fix: Resolved all warnings within ChooseTravelTargetAction.cpp. * fix: Resolved a warning in BattleGroundTactics.cpp. * fix: Resolved an unused parameter warning in DestroyItemAction.cpp. * fix: Resolved an unused variable warning in DebugAction.cpp. * fix: Resolved an unusued parameter warning in EmoteAction.cpp. * fix: Resolved several warnings in EquipAction.cpp. * fix: Resolved several warnings in FollowActions.cpp. * fix: Resolved several warnings in FishingAction.cpp. * fix: Resolved several warnings in GenericActions.cpp. * fix: Refactored CastAuraSpellAction::isUseful. * fix: Resolved a warning in GenericSpellActions.cpp. * fix: Resolved all warnings in GiveItemAction.cpp. * fix: Resolved an unused parameter warning in GreetAction.cpp. * fix: Resolved an unused parameter warning in GuildBankAction.cpp. * fix: Resolved all warnings within GuildCreateActions.cpp. * fix Resolved all warnings in GuildManagementActions.cpp. * fix: Resolved all warnings in HireAction.cpp. * fix: Resolved all warnings in HelpAction.cpp. * fix: Resolved a default copy operator generation warning in CraftValue.h. * fix: Resolved all warnings in ImbueAction.cpp. * fix: Resolved all warnings in InventoryAction.cpp. * fix: Resolved an unused parameter warning in LeaveGroupAction.cpp. * fix: Resolved all warnings in InviteToGroupAction.cpp. * fix: Resolved all warnings in LfgActions.cpp and did a small refactor. * fix: Resolved an unused variable warning in LootStrategyAction.cpp. * fix: Resolved all warnings in LootRollAction.cpp. * fix: Resolved all warnings in MailAction.cpp. * fix: Resolved all warnings in MoveToRpgTargetAction.cpp. * fix: Resolved all warnings in OpenItemAction.cpp and did a small refactor. * fix: Resolved an unused parameter warning in MoveToTravelTargetAction.cpp. * fix: Resolved all warnings in MovementActions.cpp. * fix: Resolved all warnings within PassLeadershipToMasterAction.cpp and did a small refactor. * fix: Resolved all warnings in PetAction.h and PetAction.cpp. * fix: Resolved all warnings in QueryQuestAction.cpp. * fix: Resolved all warnings in QuestAction.cpp. * fix: Resolved all warnings in RaidIccActions.cpp. * fix: Resolved all warnings in ReachTargetActions.cpp. * fix: Resolved all warnings in RememberTaxiAction.cpp. * fix: Resolved all warnings in ReadyCheckAction.cpp and did a small refactor. * fix: Resolved all warnings in ReleaseSpiritAction.cpp. * fix: Resolved all warnings in RepairAllAcction.cpp. * fix: Resolved all warnings in ResetInstancesAction.cpp. * fix: Resolved all warnings in RevealGatheringItemAction.cpp. * fix: Resolved all warnings in ReviveFromCorpseAction.cpp. * fix: Resolved all warnings in RpgSubActions.cpp. * fix: Resolved all warnings in RpgAction.cpp. * fix: Resolved an unused parameter warning in RtiAction.cpp. * fix: Refactored SecurityCheckAction.cpp. * fix: Resolved all warnings in SeeSpellAction.cpp. * fix: Resolved all warnings in SharedQuestAction.cpp. * fix: Resolved all warnings in SetHomeAction.cpp and did a small refactor. * fix: Resolved all warnings in SayAction.cpp. * fix: Resolved all warnings in SayAction.h. * fix: Resolved all warnings in StatsAction.cpp. * fix: Resolved all warnings in TameAction.cpp. * fix: Resolved all warnings in SuggestWhatToDoAction.cpp. * fix: Resolved all warnings in TalkToQuestGiverAction.cpp. * fix: Resolved all warnings in TeleportAction.cpp. * fix: Resolved all warnings in TellLosAction.cpp. * fix: Resolved all warnings in TellMasterAction.cpp. * fix: Resolved all warnings in TellReputationAction.cpp. * fix: Resolved all warnings in TellTargetAction.cpp. * fix: Resolved all warnings in TradeAction.cpp. * fix: Resolved all warnings in TradeStatusAction.cpp. * fix: Resolved all warnings in UnlockItemAction.cpp. * fix: Resolved all warnings in TrainerAction.cpp. * fix: Resolved all warnings in TravelAction.cpp. * fix: Resolved all warnings TravelAction.cpp. * fix: Resolved all warnings in UseItemAction.cpp. * fix: Resolved all warnings in VehicleActions.cpp. * fix: Rewrote WipeAction::Execute from scratch because it was guaranteed to crash. * fix: Resolved all warnings in UseMeetingStoneAction.cpp. * fix: Added explicit this in WipeAction.cpp. * fix: Resolved all warnings in WhoAction.cpp. * fix: Resolved an unused parameter warning in ChatCommandHandlerStrategy.cpp. * fix: Resolved all warnings in CombatStrategy.cpp. * fix: Resolved all warning in DuelStrategy.cpp. * fix: Resolved all warnings in FollowMasterStrategy.cpp. * fix: Resolved all warnings in GuardStrategy.cpp. * fix: Resolved all warnings in NonCombatStrategy.cpp. * fix: Resolved all warnings in RTSCStrategy.cpp. * fix: Resolved all warnings in RacialsStrategy.cpp. * fix: Resolved all warnings in UsePotionsStrategy.cpp. * fix: Resolved all warnings in GenericTriggers.cpp. * fix: Resolved all warnings within RaidKarazhanActions.cpp. * fix: Resolved all warnings in LastMovementValue.cpp. * fix: Resolved all warnings in RangeTriggers.cpp. * fix: Resolved all warnings in RaidMagtheridonActions.cpp. * fix: Resolved all warnings in RpgTriggers.cpp. * fix: Resolved all warnings in Arrow.h and Arrow.cpp. * fix: Resolved all warnings in CcTargetValue.cpp. * fix: Resolved all warnings in BudgetValues.cpp. * fix: Resolved all warnings in CurrentCcTargetValue.cpp. * fix: Resolved all warnings in DpsTargetValue.cpp. * fix: Resolved all warnings in GrindTargetValue.cpp. * fix: Refactored ItemCoutValue.cpp. * fix: Resolved all warnings in LootStrategyValue.cpp. * fix: Resolved all warnings in NearestCorpsesValue.cpp. * fix: Resolved all warnings in PartyMemberToDispel.cpp. * fix: Resolved all warnings in PartyMemverValue.cpp. * fix: Resolved all warnings in PartyMemberWithoutAuraValue.h and PartyMemberWithoutAuraValue.cpp. * fix: Resolved all warnings in PartyMemberWithoutItemValue.h and PartyMemberWithoutItemValue.cpp. * fix: Refactored PvpValues.cpp and PvpValues.h. It was too horrible to stay this way. * fix: Resolved all warnings in PossibleRpgTargetsValue.cpp. * fix: Resolved all warnings in SppelIdValue.cpp. * fix: Resolved all warnings in SnareTargetValue.cpp. * fix: Resolved all warnings in TankTargetValue.cpp. * fix: Resolved all warnings in StatsValue.cpp. * fix: Resolved all warnings in TargetValue.cpp. * fix: Resolved all warnings in GenericDKNonCombatStrategy.cpp. * fix: Resolved all warnings in DruidActions.cpp. * fix: Resolved all warnings in CatDpsDruidStrategy.cpp. * fix: Resolved all warnings in DruidShapeshiftActions.cpp. * fix: Resolved all warnings in HunterActions.h. * fix: Resolved all warnings in HunterActions.cpp. * fix: Resolved all warnings in GenericHunterStrategy.cpp. * fix: Resolved all warnings in GenericPaladinStrategy.cpp. * fix: Resolved all warnings in PriestActions.cpp. * fix: Resolved all warnings in PaladinActions.cpp. * fix: Resolved all warnings in RogueActions.cpp. * fix: Resolved all warnings in ShamanACtions.cpp. * fix: Resolved all warnings in ShamanTriggers.cpp. * fix: Resolved all warnings in WarlockActions.cpp. * fix: Resolved all warnings in TankWarlockStrategy.cpp. * fix: Resolved all warnings in GenericWarlockStrategy.cpp. * fix: Resolved all warnings in WarriorActions.cpp. * fix Resolved all warnings in ArmsWarriorStrategy.cpp. * fix: Resolved all warnings in FuryWarriorStrategy.cpp. * fix: Resolved all warnings in AzjolNerubActions.cpp. * fix: Resolved all warnings in TankWarriorStrategy.cpp. * fix: Resolved all warnings in CullingOfStratholmeActions.cpp. * fix: Resolved all warnings in DrakTharonKeepActions.cpp. * fix: Resolved all warnings in ForgeOfSoulsActions.cpp. * fix: Resolved all warnings in GundrakActions.cpp. * fix: Resolved all warnings in HallsOfLightningActions.cpp. * fix: Resolved all warnings in HallsOfStoneActions.cpp. * fix: Resolved all warnings in NexusActions.cpp. * fix: Resolved all warnings in OculusActions.cpp. * fix: Resolved all warnings in OculusMultipliers.cpp and OculusActions.h. * fix: Resolved all warnings in OldKingdomActions.cpp. * fix: Resolved all warnings in RaidGruulsLairActions.cpp. * fix: Resolved all warnings in TrialOfTheChampionStrategy.cpp. * fix: Resolved all warnings in PitOfSaronMultipliers.cpp. * fix: Resolved all the warnings in PitOfSarongActions.cpp. * fix: Resolved all warnings in TrialOfTheChampionActions.cpp. * fix: Resolved all warnings in UtgardeKeepActions.cpp. * fix: Resolved all warnings in UtgardePinnacleActions.cpp. * fix: Resolved all warnings in VioletGoldActions.cpp. * fix: Refactored the AQ20 actions. * fix: Resolved all warnings in RaidBwlActions.cpp. * fix: Resolved all warnings in RaidEoEActions.cpp. * fix: Resolved all warnings in RaidGruulsLairHelpers.cpp. * fix: Resolved all warnings in RaidIccMultipliers.cpp. * fix: RaidIccTriggers.cpp. * fix: Resolved all warnings in RaidKarazhanHelpers.cpp. * fix: Resolved all warnings in RaidMagtheriondMultipliers.cpp. * fix: Resolved all warnings in RaidMagtheridonHelpers.cpp. * fix: Resolved all warnings in RaidMcActions.cpp. * fix: Resolved all warnings in RaidOnyxiaStrategy.cpp. * fix: Resolved all warnings in RaidOsActions.cpp. * fix: Resolved a missing include in OculusActions.cpp. * fix: Resolved all warnings in UnlockTradedItemAction.cpp. * fix: Resolved all warnings in Arrow.h. * fix: Resolved all warnings in RaidOnyxiaActions.cpp. * fix: Resolved all warnings in RaidUlduarActions.cpp. * fix: Small refactor of ItemUsageValue.cpp. * fix: Resolved all warnings in ShamanTriggers.h and refactored the constructor. * fix: Resolved all warnings in NewRpgInfo.cpp. * fix: Resolved all warnings in RaidUlduarMultipliers.cpp. * fix: Resolved all warnings in RaidVoAActions.cpp. * fix: Resolved all warnings in RaidUlduarTriggers.cpp. * fix: Resolved all warnings in NewRpgAction.cpp. * fix: Resolved all warnings in PlayerbotFactory.cpp. * fix: Resolved all warnings in NewRpgStrategy.cpp. * fix: Resolved all warnings in NewRpgBaseAction.cpp. * fix: Resolved all warnings in PlayerbotMgr.cpp. * fix: Resolved all warnings in FlightMasterCache.cpp. * fix: Resolved all warnings in Engine.cpp. * fix: Resolved all warnings in PlayerbotCommandServer.cpp. * fix: Resolved all warnings in GlobalPlayerInspector.h. * fix: Resolved all warnings in PlayerbotAI.cpp and PlayerbotAI.h. * fix: Resolved all warnings in Trigger.cpp. * fix: Resolved all warnings in CustomStrategy.cpp. * fix: Resolved all warnings in PlayerbotRepository.cpp. * fix: Resolved all warnings in RandomPlayerbotMgr.cpp. * fix: Resolved all warnings in StatsCollector.cpp. * fix: Resolved all warnings in StatsWeightCalculator.cpp. * fix: Resolved all ServerFacade.cpp. * fix: Resolved all warnings in RandomPlayerbotFactory.cpp. * fix: Resolved all warnings in RandomItemMgr.cpp. * fix: Resolved all warnings in Playerbots.cpp. * fix: Resolved all warnings in TravelMgr.cpp. * fix: Resolved all warnings in TravelNode.cpp. * fix: Resolved all warnings in RaidMagtheridonActions.cpp and a circular reference. * fix: Resolved a logic issue within PvpValues.cpp that was introduced during the refactor. * fix: Resolved naked AddClass bots. (introduced by 6d60db5) * fix: Added an npos check on parseOutfitName. * fix: Made toNextActionArray based on a reference rather than hard copy. * fix: Resolved an inverted flag carrier fetching condition within PvpValues.cpp. * fix: Resolved review comments.
1 parent 8b3176e commit c925de9

236 files changed

Lines changed: 1613 additions & 1708 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Ai/Base/Actions/AcceptBattlegroundInvitationAction.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#include "AcceptBattlegroundInvitationAction.h"
77

88
#include "Event.h"
9-
#include "Playerbots.h"
9+
#include "PlayerbotAI.h"
1010

11-
bool AcceptBgInvitationAction::Execute(Event event)
11+
bool AcceptBgInvitationAction::Execute(Event)
1212
{
1313
uint8 type = 0; // arenatype if arena
1414
uint8 unk2 = 0; // unk, can be 0x0 (may be if was invited?) and 0x1
@@ -18,9 +18,9 @@ bool AcceptBgInvitationAction::Execute(Event event)
1818

1919
WorldPacket packet(CMSG_BATTLEFIELD_PORT, 20);
2020
packet << type << unk2 << (uint32)bgTypeId_ << unk << action;
21-
// packet << bgTypeId_ << action;
2221
bot->GetSession()->HandleBattleFieldPortOpcode(packet);
2322

2423
botAI->ResetStrategies();
24+
2525
return true;
2626
}

src/Ai/Base/Actions/AddLootAction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ bool AddLootAction::Execute(Event event)
2222
return AI_VALUE(LootObjectStack*, "available loot")->Add(guid);
2323
}
2424

25-
bool AddAllLootAction::Execute(Event event)
25+
bool AddAllLootAction::Execute(Event)
2626
{
2727
bool added = false;
2828

src/Ai/Base/Actions/AreaTriggerAction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ bool ReachAreaTriggerAction::Execute(Event event)
5858
return true;
5959
}
6060

61-
bool AreaTriggerAction::Execute(Event event)
61+
bool AreaTriggerAction::Execute(Event)
6262
{
6363
LastMovement& movement = context->GetValue<LastMovement&>("last area trigger")->Get();
6464

src/Ai/Base/Actions/AutoMaintenanceOnLevelupAction.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
#include "AutoMaintenanceOnLevelupAction.h"
22

3-
#include "GuildMgr.h"
3+
#include "SpellMgr.h"
4+
45
#include "PlayerbotAIConfig.h"
56
#include "PlayerbotFactory.h"
6-
#include "Playerbots.h"
77
#include "RandomPlayerbotMgr.h"
88
#include "SharedDefines.h"
99
#include "BroadcastHelper.h"
1010

11-
bool AutoMaintenanceOnLevelupAction::Execute(Event event)
11+
bool AutoMaintenanceOnLevelupAction::Execute(Event)
1212
{
1313
AutoPickTalents();
1414
AutoLearnSpell();
1515
AutoUpgradeEquip();
1616
AutoTeleportForLevel();
17+
1718
return true;
1819
}
1920

@@ -72,7 +73,7 @@ void AutoMaintenanceOnLevelupAction::LearnSpells(std::ostringstream* out)
7273
LearnQuestSpells(out);
7374
}
7475

75-
void AutoMaintenanceOnLevelupAction::LearnTrainerSpells(std::ostringstream* out)
76+
void AutoMaintenanceOnLevelupAction::LearnTrainerSpells(std::ostringstream*)
7677
{
7778
PlayerbotFactory factory(bot, bot->GetLevel());
7879
factory.InitSkills();

src/Ai/Base/Actions/BankAction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ bool BankAction::Execute(Event event)
2727
return false;
2828
}
2929

30-
bool BankAction::ExecuteBank(std::string const text, Unit* bank)
30+
bool BankAction::ExecuteBank(std::string const text, Unit*)
3131
{
3232
if (text.empty() || text == "?")
3333
{

src/Ai/Base/Actions/BattleGroundJoinAction.cpp

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
#include "PlayerbotAI.h"
1414
#include "Playerbots.h"
1515
#include "PositionValue.h"
16-
#include "UpdateTime.h"
1716

18-
bool BGJoinAction::Execute(Event event)
17+
bool BGJoinAction::Execute(Event)
1918
{
2019
uint32 queueType = AI_VALUE(uint32, "bg type");
2120
if (!queueType) // force join to fill bg
@@ -25,8 +24,6 @@ bool BGJoinAction::Execute(Event event)
2524

2625
BattlegroundQueueTypeId queueTypeId = (BattlegroundQueueTypeId)bgList[urand(0, bgList.size() - 1)];
2726
BattlegroundTypeId bgTypeId = BattlegroundMgr::BGTemplateId(queueTypeId);
28-
BattlegroundBracketId bracketId;
29-
bool isArena = false;
3027
bool isRated = false;
3128

3229
Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
@@ -38,12 +35,8 @@ bool BGJoinAction::Execute(Event event)
3835
if (!pvpDiff)
3936
return false;
4037

41-
bracketId = pvpDiff->GetBracketId();
42-
4338
if (ArenaType type = ArenaType(BattlegroundMgr::BGArenaType(queueTypeId)))
4439
{
45-
isArena = true;
46-
4740
std::vector<uint32>::iterator i = find(ratedList.begin(), ratedList.end(), queueTypeId);
4841
if (i != ratedList.end())
4942
isRated = true;
@@ -409,8 +402,6 @@ bool BGJoinAction::JoinQueue(uint32 type)
409402

410403
bracketId = pvpDiff->GetBracketId();
411404

412-
uint32 BracketSize = bg->GetMaxPlayersPerTeam() * 2;
413-
uint32 TeamSize = bg->GetMaxPlayersPerTeam();
414405
TeamId teamId = bot->GetTeamId();
415406

416407
// check if already in queue
@@ -487,8 +478,6 @@ bool BGJoinAction::JoinQueue(uint32 type)
487478
if (isArena)
488479
{
489480
isArena = true;
490-
BracketSize = type * 2;
491-
TeamSize = type;
492481
isRated = botAI->GetAiObjectContext()->GetValue<uint32>("arena type")->Get();
493482

494483
if (joinAsGroup)
@@ -653,7 +642,7 @@ bool FreeBGJoinAction::shouldJoinBg(BattlegroundQueueTypeId queueTypeId, Battleg
653642
return false;
654643
}
655644

656-
bool BGLeaveAction::Execute(Event event)
645+
bool BGLeaveAction::Execute(Event)
657646
{
658647
if (!(bot->InBattlegroundQueue() || bot->InBattleground()))
659648
return false;
@@ -1064,7 +1053,7 @@ bool BGStatusAction::Execute(Event event)
10641053
return true;
10651054
}
10661055

1067-
bool BGStatusCheckAction::Execute(Event event)
1056+
bool BGStatusCheckAction::Execute(Event)
10681057
{
10691058
if (bot->IsBeingTeleported())
10701059
return false;
@@ -1080,7 +1069,7 @@ bool BGStatusCheckAction::Execute(Event event)
10801069

10811070
bool BGStatusCheckAction::isUseful() { return bot->InBattlegroundQueue(); }
10821071

1083-
bool BGStrategyCheckAction::Execute(Event event)
1072+
bool BGStrategyCheckAction::Execute(Event)
10841073
{
10851074
bool inside_bg = bot->InBattleground() && bot->GetBattleground();
10861075
;

src/Ai/Base/Actions/BattleGroundTactics.cpp

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,8 +1364,8 @@ std::string const BGTactics::HandleConsoleCommandPrivate(WorldSession* session,
13641364
}
13651365
}
13661366
}
1367-
uint32 min = 0u;
1368-
uint32 max = vPaths->size() - 1;
1367+
int64_t min = 0u;
1368+
int64_t max = vPaths->size() - 1;
13691369
if (num >= 0) // num specified or found
13701370
{
13711371
if (num > max)
@@ -1557,7 +1557,7 @@ bool BGTactics::eyJumpDown()
15571557
//
15581558
// actual bg tactics below
15591559
//
1560-
bool BGTactics::Execute(Event event)
1560+
bool BGTactics::Execute(Event)
15611561
{
15621562
Battleground* bg = bot->GetBattleground();
15631563
if (!bg)
@@ -2185,16 +2185,6 @@ bool BGTactics::selectObjective(bool reset)
21852185
case 3: // Balanced
21862186
defendersProhab = 3;
21872187
break;
2188-
case 4:
2189-
case 5:
2190-
case 6:
2191-
case 7: // Heavy Offense
2192-
defendersProhab = 1;
2193-
break;
2194-
case 8:
2195-
case 9: // Heavy Defense
2196-
defendersProhab = 6;
2197-
break;
21982188
}
21992189

22002190
if (enemyStrategy == WS_STRATEGY_DEFENSIVE)
@@ -2226,9 +2216,14 @@ bool BGTactics::selectObjective(bool reset)
22262216
target.Relocate(enemyFC->GetPositionX(), enemyFC->GetPositionY(), enemyFC->GetPositionZ());
22272217
}
22282218
// Graveyard Camping if in lead
2229-
else if (!hasFlag && role < 8 &&
2230-
(team == TEAM_ALLIANCE && allianceScore == 2 && hordeScore == 0) ||
2231-
(team == TEAM_HORDE && hordeScore == 2 && allianceScore == 0))
2219+
else if (
2220+
!hasFlag
2221+
&& role < 8
2222+
&& (
2223+
(team == TEAM_ALLIANCE && allianceScore == 2 && hordeScore == 0)
2224+
|| (team == TEAM_HORDE && hordeScore == 2 && allianceScore == 0)
2225+
)
2226+
)
22322227
{
22332228
if (team == TEAM_ALLIANCE)
22342229
SetSafePos(WS_GY_CAMPING_HORDE, 10.0f);
@@ -2497,7 +2492,6 @@ bool BGTactics::selectObjective(bool reset)
24972492
EYBotStrategy strategyHorde = static_cast<EYBotStrategy>(GetBotStrategyForTeam(bg, TEAM_HORDE));
24982493
EYBotStrategy strategyAlliance = static_cast<EYBotStrategy>(GetBotStrategyForTeam(bg, TEAM_ALLIANCE));
24992494
EYBotStrategy strategy = (team == TEAM_ALLIANCE) ? strategyAlliance : strategyHorde;
2500-
EYBotStrategy enemyStrategy = (team == TEAM_ALLIANCE) ? strategyHorde : strategyAlliance;
25012495

25022496
auto IsOwned = [&](uint32 nodeId) -> bool
25032497
{ return eyeOfTheStormBG->GetCapturePointInfo(nodeId)._ownerTeamId == team; };
@@ -3231,7 +3225,6 @@ bool BGTactics::selectObjectiveWp(std::vector<BattleBotPath*> const& vPaths)
32313225
if (bgType == BATTLEGROUND_RB)
32323226
bgType = bg->GetBgTypeID(true);
32333227

3234-
PositionMap& posMap = context->GetValue<PositionMap&>("position")->Get();
32353228
PositionInfo pos = context->GetValue<PositionMap&>("position")->Get()["bg objective"];
32363229
if (!pos.isSet())
32373230
return false;
@@ -3326,7 +3319,9 @@ bool BGTactics::selectObjectiveWp(std::vector<BattleBotPath*> const& vPaths)
33263319

33273320
// don't pick path where bot is already closest to the paths closest point to target (it means path cant lead it
33283321
// anywhere) don't pick path where closest point is too far away
3329-
if (closestPointIndex == (reverse ? 0 : path->size() - 1) || closestPointDistToBot > botDistanceLimit)
3322+
const int64_t pathSize = path->size() - 1;
3323+
3324+
if (closestPointIndex == (reverse ? 0 : pathSize) || closestPointDistToBot > botDistanceLimit)
33303325
continue;
33313326

33323327
// creates a score based on dist-to-bot and dist-to-destination, where lower is better, and dist-to-bot is more
@@ -4249,7 +4244,7 @@ bool BGTactics::IsLockedInsideKeep()
42494244
return false;
42504245
}
42514246

4252-
bool ArenaTactics::Execute(Event event)
4247+
bool ArenaTactics::Execute(Event)
42534248
{
42544249
if (!bot->InBattleground())
42554250
{

src/Ai/Base/Actions/BossAuraActions.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ bool BossFireResistanceAction::isUseful()
1818
return bossFireResistanceTrigger.IsActive();
1919
}
2020

21-
bool BossFireResistanceAction::Execute(Event event)
21+
bool BossFireResistanceAction::Execute(Event)
2222
{
2323
PaladinFireResistanceStrategy paladinFireResistanceStrategy(botAI);
2424
botAI->ChangeStrategy(ADD_STRATEGY_CHAR + paladinFireResistanceStrategy.getName(), BotState::BOT_STATE_COMBAT);
@@ -32,7 +32,7 @@ bool BossFrostResistanceAction::isUseful()
3232
return bossFrostResistanceTrigger.IsActive();
3333
}
3434

35-
bool BossFrostResistanceAction::Execute(Event event)
35+
bool BossFrostResistanceAction::Execute(Event)
3636
{
3737
PaladinFrostResistanceStrategy paladinFrostResistanceStrategy(botAI);
3838
botAI->ChangeStrategy(ADD_STRATEGY_CHAR + paladinFrostResistanceStrategy.getName(), BotState::BOT_STATE_COMBAT);
@@ -46,7 +46,7 @@ bool BossNatureResistanceAction::isUseful()
4646
return bossNatureResistanceTrigger.IsActive();
4747
}
4848

49-
bool BossNatureResistanceAction::Execute(Event event)
49+
bool BossNatureResistanceAction::Execute(Event)
5050
{
5151
HunterNatureResistanceStrategy hunterNatureResistanceStrategy(botAI);
5252
botAI->ChangeStrategy(ADD_STRATEGY_CHAR + hunterNatureResistanceStrategy.getName(), BotState::BOT_STATE_COMBAT);
@@ -60,7 +60,7 @@ bool BossShadowResistanceAction::isUseful()
6060
return bossShadowResistanceTrigger.IsActive();
6161
}
6262

63-
bool BossShadowResistanceAction::Execute(Event event)
63+
bool BossShadowResistanceAction::Execute(Event)
6464
{
6565
PaladinShadowResistanceStrategy paladinShadowResistanceStrategy(botAI);
6666
botAI->ChangeStrategy(ADD_STRATEGY_CHAR + paladinShadowResistanceStrategy.getName(), BotState::BOT_STATE_COMBAT);

src/Ai/Base/Actions/CancelChannelAction.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
#include "Player.h"
88
#include "PlayerbotAI.h"
99

10-
bool CancelChannelAction::Execute(Event event)
10+
bool CancelChannelAction::Execute(Event)
1111
{
1212
if (bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
1313
{
1414
bot->InterruptSpell(CURRENT_CHANNELED_SPELL);
15+
1516
return true;
1617
}
18+
1719
return false;
1820
}

src/Ai/Base/Actions/CastCustomSpellAction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ bool CastRandomSpellAction::castSpell(uint32 spellId, WorldObject* wo)
334334
return botAI->CastSpell(spellId, wo->GetPositionX(), wo->GetPositionY(), wo->GetPositionZ());
335335
}
336336

337-
bool DisEnchantRandomItemAction::Execute(Event event)
337+
bool DisEnchantRandomItemAction::Execute(Event)
338338
{
339339
std::vector<Item*> items =
340340
AI_VALUE2(std::vector<Item*>, "inventory items", "usage " + std::to_string(ITEM_USAGE_DISENCHANT));

0 commit comments

Comments
 (0)