diff --git a/src/Ai/Base/Strategy/PullStrategy.cpp b/src/Ai/Base/Strategy/PullStrategy.cpp index 31351c571..1237f4aa8 100644 --- a/src/Ai/Base/Strategy/PullStrategy.cpp +++ b/src/Ai/Base/Strategy/PullStrategy.cpp @@ -49,7 +49,7 @@ PullStrategy* PullStrategy::Get(PlayerbotAI* botAI) Unit* PullStrategy::GetTarget() const { - ObjectGuid const guid = botAI->GetAiObjectContext()->GetValue("pull target")->Get(); + ObjectGuid const guid = botAI->GetAiObjectContext()->GetValue("pull strategy target")->Get(); if (guid.IsEmpty()) return nullptr; @@ -66,7 +66,7 @@ bool PullStrategy::HasTarget() const { return GetTarget() != nullptr; } void PullStrategy::SetTarget(Unit* target) { - botAI->GetAiObjectContext()->GetValue("pull target")->Set(target ? target->GetGUID() : ObjectGuid::Empty); + botAI->GetAiObjectContext()->GetValue("pull strategy target")->Set(target ? target->GetGUID() : ObjectGuid::Empty); } std::string PullStrategy::GetPullActionName() const diff --git a/src/Ai/Base/Value/TargetValue.h b/src/Ai/Base/Value/TargetValue.h index 7d766578a..94fcbdf8a 100644 --- a/src/Ai/Base/Value/TargetValue.h +++ b/src/Ai/Base/Value/TargetValue.h @@ -116,6 +116,15 @@ public: } }; +class PullStrategyTargetValue : public ManualSetValue +{ +public: + PullStrategyTargetValue(PlayerbotAI* botAI, std::string const name = "pull strategy target") + : ManualSetValue(botAI, ObjectGuid::Empty, name) + { + } +}; + class FindTargetValue : public UnitCalculatedValue, public Qualified { public: diff --git a/src/Ai/Base/ValueContext.h b/src/Ai/Base/ValueContext.h index 77d25e060..bac5fd835 100644 --- a/src/Ai/Base/ValueContext.h +++ b/src/Ai/Base/ValueContext.h @@ -241,6 +241,7 @@ public: creators["travel target"] = &ValueContext::travel_target; creators["talk target"] = &ValueContext::talk_target; creators["pull target"] = &ValueContext::pull_target; + creators["pull strategy target"] = &ValueContext::pull_strategy_target; creators["focus heal targets"] = &ValueContext::focus_heal_targets; creators["group"] = &ValueContext::group; creators["range"] = &ValueContext::range; @@ -498,6 +499,7 @@ private: static UntypedValue* next_rpg_action(PlayerbotAI* botAI) { return new NextRpgActionValue(botAI); } static UntypedValue* travel_target(PlayerbotAI* botAI) { return new TravelTargetValue(botAI); } static UntypedValue* pull_target(PlayerbotAI* botAI) { return new PullTargetValue(botAI); } + static UntypedValue* pull_strategy_target(PlayerbotAI* botAI) { return new PullStrategyTargetValue(botAI); } static UntypedValue* focus_heal_targets(PlayerbotAI* botAI) { return new FocusHealTargetValue(botAI); } static UntypedValue* bg_master(PlayerbotAI* botAI) { return new BgMasterValue(botAI); } diff --git a/src/Bot/PlayerbotAI.cpp b/src/Bot/PlayerbotAI.cpp index 98175a1dc..357678928 100644 --- a/src/Bot/PlayerbotAI.cpp +++ b/src/Bot/PlayerbotAI.cpp @@ -867,6 +867,7 @@ void PlayerbotAI::Reset(bool full) aiObjectContext->GetValue("current target")->Set(nullptr); aiObjectContext->GetValue("prioritized targets")->Reset(); aiObjectContext->GetValue("pull target")->Set(ObjectGuid::Empty); + aiObjectContext->GetValue("pull strategy target")->Set(ObjectGuid::Empty); aiObjectContext->GetValue("rpg target")->Set(GuidPosition()); aiObjectContext->GetValue("loot target")->Set(LootObject()); aiObjectContext->GetValue("lfg proposal")->Set(0); @@ -1476,6 +1477,7 @@ void PlayerbotAI::DoNextAction(bool min) aiObjectContext->GetValue("current target")->Set(nullptr); aiObjectContext->GetValue("enemy player target")->Set(nullptr); aiObjectContext->GetValue("pull target")->Set(ObjectGuid::Empty); + aiObjectContext->GetValue("pull strategy target")->Set(ObjectGuid::Empty); aiObjectContext->GetValue("loot target")->Set(LootObject()); ChangeEngine(BOT_STATE_DEAD);