Addresses #1110 - Add a system to blacklist GameObject GUID's (#1365)

* Addresses #1110

* Addresses #1110
This commit is contained in:
Jelly
2025-06-08 09:22:06 -05:00
committed by GitHub
parent cfc8e85706
commit d15ec79252
4 changed files with 24 additions and 4 deletions

View File

@@ -35,8 +35,17 @@ bool LootAction::Execute(Event /*event*/)
// bot->GetSession()->HandleLootReleaseOpcode(packet);
}
context->GetValue<LootObject>("loot target")->Set(lootObject);
return true;
// Provide a system to check if the game object id is disallowed in the user configurable list or not.
// Check if the game object id is disallowed in the user configurable list or not.
if (sPlayerbotAIConfig->disallowedGameObjects.find(lootObject.guid.GetEntry()) != sPlayerbotAIConfig->disallowedGameObjects.end())
{
return false; // Game object ID is disallowed, so do not proceed
}
else
{
context->GetValue<LootObject>("loot target")->Set(lootObject);
return true;
}
}
bool LootAction::isUseful()
@@ -147,7 +156,7 @@ bool OpenLootAction::DoLoot(LootObject& lootObject)
uint32 spellId = GetOpeningSpell(lootObject);
if (!spellId)
return false;
return botAI->CastSpell(spellId, bot);
}