Skip to content

Commit

Permalink
PullTargetGoal: interrupt the wait in WaitForWithinMeleeRange incase …
Browse files Browse the repository at this point in the history
…the target starts casting!
  • Loading branch information
Xian55 committed Oct 11, 2021
1 parent e1340bc commit 75dea7b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Core/Goals/PullTargetGoal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ protected async Task WaitForWithinMeleeRange(KeyAction item)
break;
}

if (playerReader.IsTargetCasting)
{
Log("Target started casting. Stop waiting for melee range.");
break;
}

await wait.Update(1);
}
}
Expand Down Expand Up @@ -198,7 +204,7 @@ public async Task<bool> Pull()
return false;
}

if (item.WaitForWithinMeleeRange)
if (success && item.WaitForWithinMeleeRange)
{
await WaitForWithinMeleeRange(item);
}
Expand Down

0 comments on commit 75dea7b

Please sign in to comment.