agility plugin: Check for endpoints only when defined
When an agility course has end points defined there is no need to check the amount of experience gained, only that it is gained at the right location.
This commit is contained in:
@@ -181,8 +181,9 @@ public class AgilityPlugin extends Plugin
|
||||
// Get course
|
||||
Courses course = Courses.getCourse(client.getLocalPlayer().getWorldLocation().getRegionID());
|
||||
if (course == null
|
||||
|| Math.abs(course.getLastObstacleXp() - skillGained) > 1
|
||||
|| (course.getCourseEndWorldPoints().length > 0 && Arrays.stream(course.getCourseEndWorldPoints()).noneMatch(wp -> wp.equals(client.getLocalPlayer().getWorldLocation()))))
|
||||
|| (course.getCourseEndWorldPoints().length == 0
|
||||
? Math.abs(course.getLastObstacleXp() - skillGained) > 1
|
||||
: Arrays.stream(course.getCourseEndWorldPoints()).noneMatch(wp -> wp.equals(client.getLocalPlayer().getWorldLocation()))))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user