mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
- Fixed loot trigger to respect stay strategy (#1437)
This commit is contained in:
parent
96cc0daea6
commit
761ef634da
@ -11,11 +11,21 @@
|
|||||||
|
|
||||||
bool LootAvailableTrigger::IsActive()
|
bool LootAvailableTrigger::IsActive()
|
||||||
{
|
{
|
||||||
return AI_VALUE(bool, "has available loot") &&
|
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
|
// if loot target if empty, always pass distance check
|
||||||
(sServerFacade->IsDistanceLessOrEqualThan(AI_VALUE2(float, "distance", "loot target"),
|
return AI_VALUE(bool, "has available loot") &&
|
||||||
INTERACTION_DISTANCE - 2.0f) ||
|
(distanceCheck || AI_VALUE(GuidVector, "all targets").empty());
|
||||||
AI_VALUE(GuidVector, "all targets").empty());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FarFromCurrentLootTrigger::IsActive()
|
bool FarFromCurrentLootTrigger::IsActive()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user