mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
- Fixed loot trigger to respect stay strategy (#1437)
This commit is contained in:
@@ -11,11 +11,21 @@
|
|||||||
|
|
||||||
bool LootAvailableTrigger::IsActive()
|
bool LootAvailableTrigger::IsActive()
|
||||||
{
|
{
|
||||||
|
bool distanceCheck = false;
|
||||||
|
if (botAI->HasStrategy("stay", BOT_STATE_NON_COMBAT))
|
||||||
|
{
|
||||||
|
distanceCheck =
|
||||||
|
sServerFacade->IsDistanceLessOrEqualThan(AI_VALUE2(float, "distance", "loot target"), CONTACT_DISTANCE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
distanceCheck = sServerFacade->IsDistanceLessOrEqualThan(AI_VALUE2(float, "distance", "loot target"),
|
||||||
|
INTERACTION_DISTANCE - 2.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if loot target if empty, always pass distance check
|
||||||
return AI_VALUE(bool, "has available loot") &&
|
return AI_VALUE(bool, "has available loot") &&
|
||||||
// if loot target if empty, always pass distance check
|
(distanceCheck || AI_VALUE(GuidVector, "all targets").empty());
|
||||||
(sServerFacade->IsDistanceLessOrEqualThan(AI_VALUE2(float, "distance", "loot target"),
|
|
||||||
INTERACTION_DISTANCE - 2.0f) ||
|
|
||||||
AI_VALUE(GuidVector, "all targets").empty());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FarFromCurrentLootTrigger::IsActive()
|
bool FarFromCurrentLootTrigger::IsActive()
|
||||||
|
|||||||
Reference in New Issue
Block a user