Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- checkForWP: function () {
- if(this.checkedWPs.indexOf(me.area) > -1) { return false; }
- if(this.debugPather) { print("Pather: checkForWP"); }
- /*
- Pather.checkForWP();
- returns true = took wp false = couldn't / already have
- */
- if(me.inTown || this.wpAreas.indexOf(me.area) == -1 || getWaypoint(me.area)) {
- //If in town, not in an area with a wp or already have the area wp, ignore it
- //print("in town, not in an area with a wp or already have the area wp");
- }else{
- if(this.checkedWPs.length > 0) {
- if(this.checkedWPs.indexOf(me.area) > -1){
- return false;
- }
- }
- if(this.checkedWPs.length == 0) { this.checkedWPs = []; }
- //Find the wp and see if it's worth taking it
- var wp = getUnit(2, "waypoint");
- //print("should take wp " + this.getAreaName(me.area) + ": " + !getWaypoint(me.area));
- //print("Distance to wp: " + getDistance(me,wp));
- if(wp) {
- if(!getWaypoint(me.area)) {
- //print("Trying to get wp");
- this.getWP(me.area);
- this.checkedWPs.push(me.area);
- return true;
- }
- }
- }
- this.checkedWPs.push(me.area);
- return false;
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement