mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
fix(Core/Loot): Drop hostiles-in-sight gate on loot-available trigger
This commit is contained in:
parent
5f61fe9ddf
commit
bdefd38830
@ -11,21 +11,20 @@
|
|||||||
|
|
||||||
bool LootAvailableTrigger::IsActive()
|
bool LootAvailableTrigger::IsActive()
|
||||||
{
|
{
|
||||||
bool distanceCheck = false;
|
// Strategy is non-combat-only — the engine state separation is the
|
||||||
if (botAI->HasStrategy("stay", BOT_STATE_NON_COMBAT))
|
// safety net. Don't gate on hostiles-in-sight: that locked out
|
||||||
{
|
// looting in zones with continuous respawns (e.g. cave farms).
|
||||||
distanceCheck =
|
// If a new enemy aggros mid-loot the combat engine takes over, loot
|
||||||
ServerFacade::instance().IsDistanceLessOrEqualThan(AI_VALUE2(float, "distance", "loot target"), CONTACT_DISTANCE);
|
// resumes on the next non-combat window.
|
||||||
}
|
if (!AI_VALUE(bool, "has available loot"))
|
||||||
else
|
return false;
|
||||||
{
|
|
||||||
distanceCheck = ServerFacade::instance().IsDistanceLessOrEqualThan(AI_VALUE2(float, "distance", "loot target"),
|
|
||||||
INTERACTION_DISTANCE - 2.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
// if loot target if empty, always pass distance check
|
// "stay" strategy is restrictive: only loot if corpse is at our feet.
|
||||||
return AI_VALUE(bool, "has available loot") &&
|
if (botAI->HasStrategy("stay", BOT_STATE_NON_COMBAT))
|
||||||
(distanceCheck || AI_VALUE(GuidVector, "all targets").empty());
|
return ServerFacade::instance().IsDistanceLessOrEqualThan(
|
||||||
|
AI_VALUE2(float, "distance", "loot target"), CONTACT_DISTANCE);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FarFromCurrentLootTrigger::IsActive()
|
bool FarFromCurrentLootTrigger::IsActive()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user