void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius);
void havocbot_goalrating_items(entity this, float ratingscale, vector org, float sradius);
+void havocbot_goalrating_waypoints(entity this, float ratingscale, vector org, float sradius);
entity navigation_findnearestwaypoint(entity ent, float walkfromwp);
void navigation_goalrating_end(entity this);
.void(entity this) havocbot_previous_role;
.void(entity this) havocbot_role;
+void havocbot_goalrating_waypoints(entity this, float ratingscale, vector org, float sradius)
+{
+ // rate waypoints only if there's no alternative goal
+ if(navigation_bestgoal)
+ return;
+
+ float f;
+ float range = 500;
+ sradius = max(range, (0.5 + random() * 0.5) * sradius);
+ while(sradius > 100)
+ {
+ IL_EACH(g_waypoints, vdist(it.origin - org, <, sradius)
+ && vdist(it.origin - org, >, max(100, sradius - range)),
+ {
+ if(vdist(it.origin - this.wp_goal_prev0.origin, <, range * 1.5))
+ f = 0.1;
+ else if(vdist(it.origin - this.wp_goal_prev1.origin, <, range * 1.5))
+ f = 0.1;
+ else
+ f = 0.5 + random() * 0.5;
+ navigation_routerating(this, it, ratingscale * f, 2000);
+ });
+ if(navigation_bestgoal)
+ break;
+ sradius -= range;
+ }
+};
+
void havocbot_goalrating_items(entity this, float ratingscale, vector org, float sradius)
{
float rating, d, discard, friend_distance, enemy_distance;
navigation_goalrating_start(this);
havocbot_goalrating_items(this, 10000, this.origin, 10000);
havocbot_goalrating_enemyplayers(this, 20000, this.origin, 10000);
- //havocbot_goalrating_waypoints(1, this.origin, 1000);
+ havocbot_goalrating_waypoints(this, 1, this.origin, 3000);
navigation_goalrating_end(this);
}
}
//print("routetogoal ", etos(e), "\n");
navigation_pushroute(this, e);
+ if(e.classname == "waypoint" && !(e.wpflags & WAYPOINTFLAG_PERSONAL))
+ {
+ this.wp_goal_prev1 = this.wp_goal_prev0;
+ this.wp_goal_prev0 = e;
+ }
+
if(g_jetpack)
if(e==this.navigation_jetpack_goal)
return true;
.entity goalstack28, goalstack29, goalstack30, goalstack31;
.entity nearestwaypoint;
+.entity wp_goal_prev0;
+.entity wp_goal_prev1;
+
.float nearestwaypointtimeout;
.float navigation_hasgoals;
.float lastteleporttime;
havocbot_goalrating_controlpoints(this, 10000, this.origin, 15000);
havocbot_goalrating_items(this, 8000, this.origin, 8000);
//havocbot_goalrating_enemyplayers(this, 3000, this.origin, 2000);
- //havocbot_goalrating_waypoints(1, this.origin, 1000);
+ havocbot_goalrating_waypoints(this, 1, this.origin, 3000);
navigation_goalrating_end(this);
}
}
havocbot_goalrating_items(this, 10000, this.origin, 10000);
havocbot_goalrating_enemyplayers(this, 20000, this.origin, 10000);
havocbot_goalrating_freeplayers(this, 9000, this.origin, 10000);
- //havocbot_goalrating_waypoints(1, this.origin, 1000);
+ havocbot_goalrating_waypoints(this, 1, this.origin, 3000);
navigation_goalrating_end(this);
}
}
havocbot_goalrating_items(this, 8000, this.origin, 10000);
havocbot_goalrating_enemyplayers(this, 10000, this.origin, 10000);
havocbot_goalrating_freeplayers(this, 20000, this.origin, 10000);
- //havocbot_goalrating_waypoints(1, this.origin, 1000);
+ havocbot_goalrating_waypoints(this, 1, this.origin, 3000);
navigation_goalrating_end(this);
}
}
navigation_goalrating_start(this);
havocbot_goalrating_items(this, 10000, this.origin, 10000);
havocbot_goalrating_enemyplayers(this, 20000, this.origin, 10000);
- //havocbot_goalrating_waypoints(1, this.origin, 1000);
+ havocbot_goalrating_waypoints(this, 1, this.origin, 3000);
navigation_goalrating_end(this);
}