Skip to content

Commit

Permalink
Remove los check for most gameobject search actions
Browse files Browse the repository at this point in the history
  • Loading branch information
davidonete committed Mar 23, 2024
1 parent 36cc175 commit 8d1f423
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion playerbot/strategy/actions/AcceptQuestAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ bool AcceptQuestAction::Execute(Event& event)
if (unit && text == "*" && sqrt(bot->GetDistance(unit)) <= INTERACTION_DISTANCE)
hasAccept |= QuestAction::ProcessQuests(unit);
}
std::list<ObjectGuid> gos = AI_VALUE(std::list<ObjectGuid>, "nearest game objects");
std::list<ObjectGuid> gos = AI_VALUE(std::list<ObjectGuid>, "nearest game objects no los");
for (std::list<ObjectGuid>::iterator i = gos.begin(); i != gos.end(); i++)
{
GameObject* go = ai->GetGameObject(*i);
Expand Down
2 changes: 1 addition & 1 deletion playerbot/strategy/actions/AddLootAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ bool AddAllLootAction::Execute(Event& event)
Player* requester = event.getOwner() ? event.getOwner() : GetMaster();
bool added = false;

std::list<ObjectGuid> gos = context->GetValue<std::list<ObjectGuid> >("nearest game objects")->Get();
std::list<ObjectGuid> gos = context->GetValue<std::list<ObjectGuid> >("nearest game objects no los")->Get();
for (std::list<ObjectGuid>::iterator i = gos.begin(); i != gos.end(); i++)
added |= AddLoot(requester, *i);

Expand Down
5 changes: 2 additions & 3 deletions playerbot/strategy/actions/CheckValuesAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ bool CheckValuesAction::Execute(Event& event)
std::list<ObjectGuid> all_targets = AI_VALUE(std::list<ObjectGuid>, "all targets");
std::list<ObjectGuid> npcs = AI_VALUE(std::list<ObjectGuid>, "nearest npcs");
std::list<ObjectGuid> corpses = AI_VALUE(std::list<ObjectGuid>, "nearest corpses");
std::list<ObjectGuid> gos = AI_VALUE(std::list<ObjectGuid>, "nearest game objects");
std::list<ObjectGuid> gos = AI_VALUE(std::list<ObjectGuid>, "nearest game objects no los");
std::list<ObjectGuid> nfp = AI_VALUE(std::list<ObjectGuid>, "nearest friendly players");
//if (!ai->HasStrategy("debug", BotState::BOT_STATE_NON_COMBAT))
// context->ClearExpiredValues();

return true;
}
2 changes: 1 addition & 1 deletion playerbot/strategy/actions/GuildBankAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ bool GuildBankAction::Execute(Event& event)
return false;
}

std::list<ObjectGuid> gos = *ai->GetAiObjectContext()->GetValue<std::list<ObjectGuid> >("nearest game objects");
std::list<ObjectGuid> gos = *ai->GetAiObjectContext()->GetValue<std::list<ObjectGuid> >("nearest game objects no los");
for (std::list<ObjectGuid>::iterator i = gos.begin(); i != gos.end(); ++i)
{
GameObject* go = ai->GetGameObject(*i);
Expand Down
2 changes: 1 addition & 1 deletion playerbot/strategy/actions/LootAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ bool StoreLootAction::IsLootAllowed(ItemQualifier& itemQualifier, PlayerbotAI *a

bool ReleaseLootAction::Execute(Event& event)
{
std::list<ObjectGuid> gos = context->GetValue<std::list<ObjectGuid> >("nearest game objects")->Get();
std::list<ObjectGuid> gos = context->GetValue<std::list<ObjectGuid> >("nearest game objects no los")->Get();
for (std::list<ObjectGuid>::iterator i = gos.begin(); i != gos.end(); i++)
{
WorldPacket packet(CMSG_LOOT_RELEASE, 8);
Expand Down
2 changes: 1 addition & 1 deletion playerbot/strategy/actions/MailAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ void MailProcessor::RemoveMail(Player* bot, uint32 id, ObjectGuid mailbox)

ObjectGuid MailProcessor::FindMailbox(PlayerbotAI* ai)
{
std::list<ObjectGuid> gos = *ai->GetAiObjectContext()->GetValue<std::list<ObjectGuid> >("nearest game objects");
std::list<ObjectGuid> gos = *ai->GetAiObjectContext()->GetValue<std::list<ObjectGuid> >("nearest game objects no los");
ObjectGuid mailbox;
for (std::list<ObjectGuid>::iterator i = gos.begin(); i != gos.end(); ++i)
{
Expand Down
2 changes: 1 addition & 1 deletion playerbot/strategy/actions/QuestAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ bool QuestAction::Execute(Event& event)
if (unit && bot->GetDistance(unit) <= INTERACTION_DISTANCE)
result |= ProcessQuests(unit);
}
std::list<ObjectGuid> gos = AI_VALUE(std::list<ObjectGuid>, "nearest game objects");
std::list<ObjectGuid> gos = AI_VALUE(std::list<ObjectGuid>, "nearest game objects no los");
for (std::list<ObjectGuid>::iterator i = gos.begin(); i != gos.end(); i++)
{
GameObject* go = ai->GetGameObject(*i);
Expand Down
2 changes: 1 addition & 1 deletion playerbot/strategy/actions/RewardAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ bool RewardAction::Execute(Event& event)
}
}

std::list<ObjectGuid> gos = AI_VALUE(std::list<ObjectGuid>, "nearest game objects");
std::list<ObjectGuid> gos = AI_VALUE(std::list<ObjectGuid>, "nearest game objects no los");
for (std::list<ObjectGuid>::iterator i = gos.begin(); i != gos.end(); i++)
{
GameObject* go = ai->GetGameObject(*i);
Expand Down
2 changes: 1 addition & 1 deletion playerbot/strategy/actions/TeleportAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using namespace ai;
bool TeleportAction::Execute(Event& event)
{
Player* requester = event.getOwner() ? event.getOwner() : GetMaster();
std::list<ObjectGuid> gos = *context->GetValue<std::list<ObjectGuid> >("nearest game objects");
std::list<ObjectGuid> gos = *context->GetValue<std::list<ObjectGuid> >("nearest game objects no los");
for (std::list<ObjectGuid>::iterator i = gos.begin(); i != gos.end(); i++)
{
GameObject* go = ai->GetGameObject(*i);
Expand Down
2 changes: 1 addition & 1 deletion playerbot/strategy/actions/TellLosAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bool TellLosAction::Execute(Event& event)

if (param.empty() || param == "gos" || param == "game objects")
{
ListGameObjects(requester, "--- Game objects ---", *context->GetValue<std::list<ObjectGuid> >("nearest game objects"));
ListGameObjects(requester, "--- Game objects ---", *context->GetValue<std::list<ObjectGuid> >("nearest game objects no los"));
}

if (param.empty() || param == "players")
Expand Down
2 changes: 1 addition & 1 deletion playerbot/strategy/actions/UseItemAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ bool UseRandomQuestItemAction::Execute(Event& event)
}
}
std::list<ObjectGuid> gos = AI_VALUE(std::list<ObjectGuid>, ("nearest game objects"));
std::list<ObjectGuid> gos = AI_VALUE(std::list<ObjectGuid>, ("nearest game objects no los"));
for (auto& go : gos)
{
GameObject* gameObject = ai->GetGameObject(go);
Expand Down

0 comments on commit 8d1f423

Please sign in to comment.