Skip to content

Commit

Permalink
-Mount fix: Bots no longer mount up when have enemies nearby but no c…
Browse files Browse the repository at this point in the history
…urrent target that is far away.
  • Loading branch information
mostlikely4r committed Dec 14, 2023
1 parent 1b34105 commit 9c52465
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion playerbot/strategy/actions/CheckMountStateAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ bool CheckMountStateAction::Execute(Event& event)

if (hasEnemy)
{
float distToTarget = AI_VALUE2(float, "distance", "current target");
float distToTarget = AI_VALUE(Unit*, "current target") ? AI_VALUE2(float, "distance", "current target") : 0;
canAttackTarget = sServerFacade.IsDistanceLessThan(distToTarget, GetAttackDistance());
shouldChaseTarget = sServerFacade.IsDistanceGreaterThan(distToTarget, 45.0f) && AI_VALUE2(bool, "moving", "current target");
farFromTarget = sServerFacade.IsDistanceGreaterThan(distToTarget, 40.0f);
Expand Down

0 comments on commit 9c52465

Please sign in to comment.