w.model = "";
return w;
-};
+}
// add a new link to the spawnfunc_waypoint, replacing the furthest link it already has
void waypoint_addlink(entity from, entity to)
if (from.wp01mincost < c) {from.wp02 = to;from.wp02mincost = c;return;} from.wp02 = from.wp01;from.wp02mincost = from.wp01mincost;
if (from.wp00mincost < c) {from.wp01 = to;from.wp01mincost = c;return;} from.wp01 = from.wp00;from.wp01mincost = from.wp00mincost;
from.wp00 = to;from.wp00mincost = c;return;
-};
+}
// relink this spawnfunc_waypoint
// (precompile a list of all reachable waypoints from this spawnfunc_waypoint)
}
navigation_testtracewalk = 0;
self.wplinked = TRUE;
-};
+}
void waypoint_clearlinks(entity wp)
{
wp.wp24mincost = wp.wp25mincost = wp.wp26mincost = wp.wp27mincost = wp.wp28mincost = wp.wp29mincost = wp.wp30mincost = wp.wp31mincost = f;
wp.wplinked = FALSE;
-};
+}
// tell a spawnfunc_waypoint to relink
void waypoint_schedulerelink(entity wp)
// schedule a relink after other waypoints have had a chance to spawn
waypoint_clearlinks(self);
//waypoint_schedulerelink(self);
-};
+}
// remove a spawnfunc_waypoint, and schedule all neighbors to relink
void waypoint_remove(entity e)
waypoint_schedulerelink(e.wp31);
// and now remove the spawnfunc_waypoint
remove(e);
-};
+}
// empties the map of waypoints
void waypoint_removeall()
remove(head);
head = next;
}
-};
+}
// tell all waypoints to relink
// (is this useful at all?)
waypoint_schedulerelink(head);
head = head.chain;
}
-};
+}
// Load waypoint links from file
float waypoint_load_links()
botframe_cachedwaypointlinks = TRUE;
return TRUE;
-};
+}
void waypoint_load_links_hardwired()
{
dprint(" waypoint links from maps/");
dprint(mapname);
dprint(".waypoints.hardwired\n");
-};
+}
// Save all waypoint links to a file
void waypoint_save_links()
print(" waypoints links to maps/");
print(mapname);
print(".waypoints.cache\n");
-};
+}
// save waypoints to gamedir/data/maps/mapname.waypoints
void waypoint_saveall()
}
waypoint_save_links();
botframe_loadedforcedlinks = FALSE;
-};
+}
// load waypoints from file
float waypoint_loadall()
dprint(" failed\n");
}
return cwp + cwb;
-};
+}
vector waypoint_fixorigin(vector position)
{
return;
waypoint_spawnforitem_force(e, e.origin);
-};
+}
void waypoint_spawnforteleporter_boxes(entity e, vector org1, vector org2, vector destination1, vector destination2, float timetaken)
{
// (teleporters are not goals, so this is probably useless)
e.nearestwaypoint = w;
e.nearestwaypointtimeout = time + 1000000000;
-};
+}
void waypoint_spawnforteleporter_v(entity e, vector org, vector destination, float timetaken)
{
org = waypoint_fixorigin(org);
destination = waypoint_fixorigin(destination);
waypoint_spawnforteleporter_boxes(e, org, org, destination, destination, timetaken);
-};
+}
void waypoint_spawnforteleporter(entity e, vector destination, float timetaken)
{
destination = waypoint_fixorigin(destination);
waypoint_spawnforteleporter_boxes(e, e.absmin, e.absmax, destination, destination, timetaken);
-};
+}
entity waypoint_spawnpersonal(vector position)
{
waypoint_schedulerelink(w);
return w;
-};
+}
void botframe_showwaypointlinks()
{
}
player = find(player, classname, "player");
}
-};
+}