+ else
+ {
+ // NOTE unlike waypoints, items hold incoming links
+ navigation_item_initlinks_ifneeded(this.goalentity);
+ int link_num = navigation_item_getlinknum(this.goalentity, nearest_wp.enemy);
+ if (link_num >= 0)
+ {
+ if (navigation_item_iswalkablelink(this.goalentity, link_num))
+ e = nearest_wp.enemy;
+ }
+ else // untested link
+ {
+ entity wp = nearest_wp.enemy;
+ entity goal = this.goalentity;
+ bool walkable = false;
+ if (checkpvs(wp.origin, goal))
+ {
+ set_tracewalk_dest(goal, wp.origin, false);
+ if (vdist(tracewalk_dest - wp.origin, <, 1050)
+ && tracewalk(goal, wp.origin, PL_MIN_CONST, PL_MAX_CONST,
+ tracewalk_dest, tracewalk_dest_height, bot_navigation_movemode))
+ {
+ walkable = true;
+ e = nearest_wp.enemy;
+ }
+ }
+ navigation_item_add_link(wp, goal, walkable);
+ }
+ }