From 8d1f423bd7c1220db3c1b027563fb88ea3500772 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 23 Mar 2024 20:26:19 +0000 Subject: [PATCH] Remove los check for most gameobject search actions --- playerbot/strategy/actions/AcceptQuestAction.cpp | 2 +- playerbot/strategy/actions/AddLootAction.cpp | 2 +- playerbot/strategy/actions/CheckValuesAction.cpp | 5 ++--- playerbot/strategy/actions/GuildBankAction.cpp | 2 +- playerbot/strategy/actions/LootAction.cpp | 2 +- playerbot/strategy/actions/MailAction.cpp | 2 +- playerbot/strategy/actions/QuestAction.cpp | 2 +- playerbot/strategy/actions/RewardAction.cpp | 2 +- playerbot/strategy/actions/TeleportAction.cpp | 2 +- playerbot/strategy/actions/TellLosAction.cpp | 2 +- playerbot/strategy/actions/UseItemAction.cpp | 2 +- 11 files changed, 12 insertions(+), 13 deletions(-) diff --git a/playerbot/strategy/actions/AcceptQuestAction.cpp b/playerbot/strategy/actions/AcceptQuestAction.cpp index 8e0102a9..c81453da 100644 --- a/playerbot/strategy/actions/AcceptQuestAction.cpp +++ b/playerbot/strategy/actions/AcceptQuestAction.cpp @@ -46,7 +46,7 @@ bool AcceptQuestAction::Execute(Event& event) if (unit && text == "*" && sqrt(bot->GetDistance(unit)) <= INTERACTION_DISTANCE) hasAccept |= QuestAction::ProcessQuests(unit); } - std::list gos = AI_VALUE(std::list, "nearest game objects"); + std::list gos = AI_VALUE(std::list, "nearest game objects no los"); for (std::list::iterator i = gos.begin(); i != gos.end(); i++) { GameObject* go = ai->GetGameObject(*i); diff --git a/playerbot/strategy/actions/AddLootAction.cpp b/playerbot/strategy/actions/AddLootAction.cpp index d5a9ef75..36293a27 100644 --- a/playerbot/strategy/actions/AddLootAction.cpp +++ b/playerbot/strategy/actions/AddLootAction.cpp @@ -29,7 +29,7 @@ bool AddAllLootAction::Execute(Event& event) Player* requester = event.getOwner() ? event.getOwner() : GetMaster(); bool added = false; - std::list gos = context->GetValue >("nearest game objects")->Get(); + std::list gos = context->GetValue >("nearest game objects no los")->Get(); for (std::list::iterator i = gos.begin(); i != gos.end(); i++) added |= AddLoot(requester, *i); diff --git a/playerbot/strategy/actions/CheckValuesAction.cpp b/playerbot/strategy/actions/CheckValuesAction.cpp index e43ad1ae..5a992ad2 100644 --- a/playerbot/strategy/actions/CheckValuesAction.cpp +++ b/playerbot/strategy/actions/CheckValuesAction.cpp @@ -35,9 +35,8 @@ bool CheckValuesAction::Execute(Event& event) std::list all_targets = AI_VALUE(std::list, "all targets"); std::list npcs = AI_VALUE(std::list, "nearest npcs"); std::list corpses = AI_VALUE(std::list, "nearest corpses"); - std::list gos = AI_VALUE(std::list, "nearest game objects"); + std::list gos = AI_VALUE(std::list, "nearest game objects no los"); std::list nfp = AI_VALUE(std::list, "nearest friendly players"); - //if (!ai->HasStrategy("debug", BotState::BOT_STATE_NON_COMBAT)) - // context->ClearExpiredValues(); + return true; } diff --git a/playerbot/strategy/actions/GuildBankAction.cpp b/playerbot/strategy/actions/GuildBankAction.cpp index e7fbf454..19b69a88 100644 --- a/playerbot/strategy/actions/GuildBankAction.cpp +++ b/playerbot/strategy/actions/GuildBankAction.cpp @@ -22,7 +22,7 @@ bool GuildBankAction::Execute(Event& event) return false; } - std::list gos = *ai->GetAiObjectContext()->GetValue >("nearest game objects"); + std::list gos = *ai->GetAiObjectContext()->GetValue >("nearest game objects no los"); for (std::list::iterator i = gos.begin(); i != gos.end(); ++i) { GameObject* go = ai->GetGameObject(*i); diff --git a/playerbot/strategy/actions/LootAction.cpp b/playerbot/strategy/actions/LootAction.cpp index e7f663a3..64e5fb2e 100644 --- a/playerbot/strategy/actions/LootAction.cpp +++ b/playerbot/strategy/actions/LootAction.cpp @@ -421,7 +421,7 @@ bool StoreLootAction::IsLootAllowed(ItemQualifier& itemQualifier, PlayerbotAI *a bool ReleaseLootAction::Execute(Event& event) { - std::list gos = context->GetValue >("nearest game objects")->Get(); + std::list gos = context->GetValue >("nearest game objects no los")->Get(); for (std::list::iterator i = gos.begin(); i != gos.end(); i++) { WorldPacket packet(CMSG_LOOT_RELEASE, 8); diff --git a/playerbot/strategy/actions/MailAction.cpp b/playerbot/strategy/actions/MailAction.cpp index 744e616a..e5d58032 100644 --- a/playerbot/strategy/actions/MailAction.cpp +++ b/playerbot/strategy/actions/MailAction.cpp @@ -276,7 +276,7 @@ void MailProcessor::RemoveMail(Player* bot, uint32 id, ObjectGuid mailbox) ObjectGuid MailProcessor::FindMailbox(PlayerbotAI* ai) { - std::list gos = *ai->GetAiObjectContext()->GetValue >("nearest game objects"); + std::list gos = *ai->GetAiObjectContext()->GetValue >("nearest game objects no los"); ObjectGuid mailbox; for (std::list::iterator i = gos.begin(); i != gos.end(); ++i) { diff --git a/playerbot/strategy/actions/QuestAction.cpp b/playerbot/strategy/actions/QuestAction.cpp index 45ef8ac7..36bd2caa 100644 --- a/playerbot/strategy/actions/QuestAction.cpp +++ b/playerbot/strategy/actions/QuestAction.cpp @@ -37,7 +37,7 @@ bool QuestAction::Execute(Event& event) if (unit && bot->GetDistance(unit) <= INTERACTION_DISTANCE) result |= ProcessQuests(unit); } - std::list gos = AI_VALUE(std::list, "nearest game objects"); + std::list gos = AI_VALUE(std::list, "nearest game objects no los"); for (std::list::iterator i = gos.begin(); i != gos.end(); i++) { GameObject* go = ai->GetGameObject(*i); diff --git a/playerbot/strategy/actions/RewardAction.cpp b/playerbot/strategy/actions/RewardAction.cpp index 489507f7..e4f69c32 100644 --- a/playerbot/strategy/actions/RewardAction.cpp +++ b/playerbot/strategy/actions/RewardAction.cpp @@ -28,7 +28,7 @@ bool RewardAction::Execute(Event& event) } } - std::list gos = AI_VALUE(std::list, "nearest game objects"); + std::list gos = AI_VALUE(std::list, "nearest game objects no los"); for (std::list::iterator i = gos.begin(); i != gos.end(); i++) { GameObject* go = ai->GetGameObject(*i); diff --git a/playerbot/strategy/actions/TeleportAction.cpp b/playerbot/strategy/actions/TeleportAction.cpp index 48868f8b..cb313e88 100644 --- a/playerbot/strategy/actions/TeleportAction.cpp +++ b/playerbot/strategy/actions/TeleportAction.cpp @@ -9,7 +9,7 @@ using namespace ai; bool TeleportAction::Execute(Event& event) { Player* requester = event.getOwner() ? event.getOwner() : GetMaster(); - std::list gos = *context->GetValue >("nearest game objects"); + std::list gos = *context->GetValue >("nearest game objects no los"); for (std::list::iterator i = gos.begin(); i != gos.end(); i++) { GameObject* go = ai->GetGameObject(*i); diff --git a/playerbot/strategy/actions/TellLosAction.cpp b/playerbot/strategy/actions/TellLosAction.cpp index 87580e44..a7d2d265 100644 --- a/playerbot/strategy/actions/TellLosAction.cpp +++ b/playerbot/strategy/actions/TellLosAction.cpp @@ -27,7 +27,7 @@ bool TellLosAction::Execute(Event& event) if (param.empty() || param == "gos" || param == "game objects") { - ListGameObjects(requester, "--- Game objects ---", *context->GetValue >("nearest game objects")); + ListGameObjects(requester, "--- Game objects ---", *context->GetValue >("nearest game objects no los")); } if (param.empty() || param == "players") diff --git a/playerbot/strategy/actions/UseItemAction.cpp b/playerbot/strategy/actions/UseItemAction.cpp index 583673dc..77d08ffb 100644 --- a/playerbot/strategy/actions/UseItemAction.cpp +++ b/playerbot/strategy/actions/UseItemAction.cpp @@ -1212,7 +1212,7 @@ bool UseRandomQuestItemAction::Execute(Event& event) } } - std::list gos = AI_VALUE(std::list, ("nearest game objects")); + std::list gos = AI_VALUE(std::list, ("nearest game objects no los")); for (auto& go : gos) { GameObject* gameObject = ai->GetGameObject(go);