Merge branch 'master' into master

This commit is contained in:
Bobblybook
2024-11-08 20:53:29 +11:00
committed by GitHub
10 changed files with 261 additions and 267 deletions

View File

@@ -188,7 +188,7 @@ bool LfgAcceptAction::Execute(Event event)
LOG_INFO("playerbots", "Bot {} {}:{} <{}> is in combat and refuses LFG proposal {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(),
bot->GetName().c_str(), id);
sLFGMgr->UpdateProposal(id, bot->GetGUID(), false);
sLFGMgr->UpdateProposal(id, bot->GetGUID(), true);
return true;
}

View File

@@ -15,9 +15,13 @@
bool QuestAction::Execute(Event event)
{
ObjectGuid guid = event.getObject();
Player* master = GetMaster();
// Checks if the bot and botAI are valid
if (!bot || !botAI)
return false;
// Sets guid based on bot or master target
if (!guid)
{
if (!master)
@@ -36,19 +40,27 @@ bool QuestAction::Execute(Event event)
}
bool result = false;
// Check the nearest NPCs
GuidVector npcs = AI_VALUE(GuidVector, "nearest npcs");
for (const auto npc : npcs)
for (const auto& npc : npcs)
{
Unit* unit = botAI->GetUnit(npc);
if (unit && bot->GetDistance(unit) <= INTERACTION_DISTANCE)
{
result |= ProcessQuests(unit);
}
}
// Checks the nearest game objects
std::list<ObjectGuid> gos = AI_VALUE(std::list<ObjectGuid>, "nearest game objects");
for (const auto go : gos)
for (const auto& go : gos)
{
GameObject* gameobj = botAI->GetGameObject(go);
if (gameobj && bot->GetDistance(gameobj) <= INTERACTION_DISTANCE)
{
result |= ProcessQuests(gameobj);
}
}
return result;

View File

@@ -207,6 +207,7 @@ ItemUsage ItemUsageValue::QueryItemUsageForEquip(ItemTemplate const* itemProto)
uint8 possibleSlots = 1;
uint8 dstSlot = botAI->FindEquipSlot(itemProto, NULL_SLOT, true);
if (dstSlot == EQUIPMENT_SLOT_FINGER1 || dstSlot == EQUIPMENT_SLOT_TRINKET1)
{
possibleSlots = 2;