From 0ad188c7f8c39e81266b561fdb30d40365d5630e Mon Sep 17 00:00:00 2001 From: Bobblybook Date: Mon, 30 Sep 2024 23:58:21 +1000 Subject: [PATCH] Variable cleanup --- .../wotlk/utgardekeep/UtgardeKeepActions.cpp | 15 +++++++-------- .../wotlk/utgardekeep/UtgardeKeepMultipliers.cpp | 6 ++---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepActions.cpp b/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepActions.cpp index f3fcf710..2c17366d 100644 --- a/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepActions.cpp +++ b/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepActions.cpp @@ -4,7 +4,7 @@ bool AttackFrostTombAction::Execute(Event event) { - Unit* frost_tomb = nullptr; + Unit* frostTomb = nullptr; // Target is not findable from threat table using AI_VALUE2(), // therefore need to search manually for the unit name @@ -15,27 +15,26 @@ bool AttackFrostTombAction::Execute(Event event) Unit* unit = botAI->GetUnit(*i); if (unit && unit->GetName() == "Frost Tomb") { - frost_tomb = unit; + frostTomb = unit; break; } } - if (!frost_tomb || AI_VALUE(Unit*, "current target") == frost_tomb) + if (!frostTomb || AI_VALUE(Unit*, "current target") == frostTomb) { return false; } - return Attack(frost_tomb); + return Attack(frostTomb); } // TODO: Possibly add player stacking behaviour close to tank, to prevent Skarvald charging ranged bool AttackDalronnAction::Execute(Event event) { - Unit* target = AI_VALUE2(Unit*, "find target", "dalronn the controller"); - - if (!target || AI_VALUE(Unit*, "current target") == target) + Unit* boss = AI_VALUE2(Unit*, "find target", "dalronn the controller"); + if (!boss || AI_VALUE(Unit*, "current target") == boss) { return false; } - return Attack(target); + return Attack(boss); } bool IngvarStopCastingAction::Execute(Event event) diff --git a/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepMultipliers.cpp b/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepMultipliers.cpp index 84c41427..7d785e4c 100644 --- a/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepMultipliers.cpp +++ b/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepMultipliers.cpp @@ -7,7 +7,6 @@ float PrinceKelesethMultiplier::GetValue(Action* action) { Unit* boss = AI_VALUE2(Unit*, "find target", "prince keleseth"); - if (!boss) { return 1.0f; @@ -37,7 +36,7 @@ float SkarvaldAndDalronnMultiplier::GetValue(Action* action) float IngvarThePlundererMultiplier::GetValue(Action* action) { - Unit* boss = AI_VALUE2(Unit*, "find target", "ingvar the plunderer"); + Unit* boss = AI_VALUE2(Unit*, "find target", "ingvar the plunderer"); bool isTank = botAI->IsTank(bot); if (!boss) { @@ -58,8 +57,7 @@ float IngvarThePlundererMultiplier::GetValue(Action* action) { if (dynamic_cast(action)) { - std::string const name = action->getName(); - uint32 spellId = AI_VALUE2(uint32, "spell id", name); + uint32 spellId = AI_VALUE2(uint32, "spell id", action->getName()); SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (!spellInfo) {