NSNavAI: Add method RouteToPositionDenyFlags(). Same as RouteToPosition() but will accept a link-flag filter mask.
This commit is contained in:
parent
40aee258ce
commit
5bdbe2cc47
2 changed files with 9 additions and 1 deletions
|
@ -77,6 +77,8 @@ public:
|
|||
virtual void CheckRoute(void);
|
||||
/** When called, will plot a route to a given world coordinate and start moving. */
|
||||
virtual void RouteToPosition(vector);
|
||||
/** When called, will plot a route to a given world coordinate and start moving, ignoring any links that contain the given link flags. */
|
||||
virtual void RouteToPositionDenyFlags(vector, int);
|
||||
/** When called, will start following a path_corner */
|
||||
virtual void ChasePath(string startPath);
|
||||
/** Internal use only. Called every frame to see our route progression. */
|
||||
|
|
|
@ -284,6 +284,12 @@ NSNavAI::GetRouteDirection(void)
|
|||
|
||||
void
|
||||
NSNavAI::RouteToPosition(vector destination)
|
||||
{
|
||||
RouteToPositionDenyFlags(destination, 0i);
|
||||
}
|
||||
|
||||
void
|
||||
NSNavAI::RouteToPositionDenyFlags(vector destination, int denylinkflags)
|
||||
{
|
||||
/* engine calls this upon successfully creating a route */
|
||||
static void RouteToPosition_RouteCB(entity ent, vector dest, int numnodes, nodeslist_t *nodelist)
|
||||
|
@ -332,7 +338,7 @@ NSNavAI::RouteToPosition(vector destination)
|
|||
RouteClear();
|
||||
|
||||
if (!m_iNodes) {
|
||||
route_calculate(this, destination, 0, RouteToPosition_RouteCB);
|
||||
route_calculate(this, destination, denylinkflags, RouteToPosition_RouteCB);
|
||||
m_vecLastNode = destination;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue