}
}
if(!locked_goal)
- navigation_poptouchedgoals(this);
+ {
+ if(navigation_poptouchedgoals(this) && this.bot_strategytime < time + 1)
+ this.bot_strategytime = 0;
+ }
// if ran out of goals try to use an alternative goal or get a new strategy asap
if(this.goalcurrent == NULL)
// removes any currently touching waypoints from the goal stack
// (this is how bots detect if they reached a goal)
-void navigation_poptouchedgoals(entity this)
+int navigation_poptouchedgoals(entity this)
{
+ int removed_goals = 0;
if(this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT)
{
// make sure jumppad is really hit, don't rely on distance based checks
this.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_REACHED;
}
navigation_poproute(this);
+ ++removed_goals;
}
else
- return;
+ return removed_goals;
}
// If for some reason the bot is closer to the next goal, pop the current one
{
LOG_DEBUG("path optimized for ", this.netname, ", removed a goal from the queue");
navigation_poproute(this);
+ ++removed_goals;
if(this.goalcurrent && this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT)
- return;
+ return removed_goals;
// TODO this may also be a nice idea to do "early" (e.g. by
// manipulating the vlen() comparisons) to shorten paths in
// general - this would make bots walk more "on rails" than
}
navigation_poproute(this);
+ ++removed_goals;
if(this.goalcurrent && this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT)
- return;
+ return removed_goals;
}
}
}
}
navigation_poproute(this);
+ ++removed_goals;
if(this.goalcurrent && this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT)
- return;
+ return removed_goals;
}
+ return removed_goals;
}
entity navigation_get_really_close_waypoint(entity this)
void navigation_markroutes(entity this, entity fixed_source_waypoint);
void navigation_markroutes_inverted(entity fixed_source_waypoint);
void navigation_routerating(entity this, entity e, float f, float rangebias);
-void navigation_poptouchedgoals(entity this);
+int navigation_poptouchedgoals(entity this);
void navigation_goalrating_start(entity this);
void navigation_goalrating_end(entity this);
void navigation_unstuck(entity this);