setsize(w, m1 - w.origin, m2 - w.origin);
if (vlen(w.size) > 0)
w.wpisbox = TRUE;
-
+
if(!w.wpisbox)
{
setsize(w, PL_MIN - '1 1 0', PL_MAX + '1 1 0');
}
else
{
- if(cvar("developer"))
+ if(autocvar_developer)
{
print("A generated waypoint is stuck in solid at ", vtos(w.origin), "\n");
backtrace("Waypoint stuck");
waypoint_clearlinks(w);
//waypoint_schedulerelink(w);
- if (cvar("g_waypointeditor"))
+ if (autocvar_g_waypointeditor)
{
m1 = w.mins;
m2 = w.maxs;
local entity e;
local vector sv, sm1, sm2, ev, em1, em2, dv;
- stepheightvec = cvar("sv_stepheight") * '0 0 1';
- bot_navigation_movemode = ((cvar("bot_navigation_ignoreplayers")) ? MOVE_NOMONSTERS : MOVE_NORMAL);
+ bot_calculate_stepheightvec();
+
+ bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
//dprint("waypoint_think wpisbox = ", ftos(self.wpisbox), "\n");
sm1 = self.origin + self.mins;
if (wp == world)
return;
// TODO: add some sort of visible box in edit mode for box waypoints
- if (cvar("g_waypointeditor"))
+ if (autocvar_g_waypointeditor)
{
local vector m1, m2;
m1 = wp.mins;
// Search "from" waypoint
if(wp_from.origin!=wp_from_pos)
{
- wp_from = findradius(wp_from_pos, 1);
+ wp_from = findradius(wp_from_pos, 5);
found = FALSE;
while(wp_from)
{
- if(vlen(wp_from.origin-wp_from_pos)<1)
+ if(vlen(wp_from.origin-wp_from_pos)<5)
if(wp_from.classname == "waypoint")
{
found = TRUE;
}
// Search "to" waypoint
- wp_to = findradius(wp_to_pos, 1);
+ wp_to = findradius(wp_to_pos, 5);
found = FALSE;
while(wp_to)
{
- if(vlen(wp_to.origin-wp_to_pos)<1)
+ if(vlen(wp_to.origin-wp_to_pos)<5)
if(wp_to.classname == "waypoint")
{
found = TRUE;
waypoint_spawnforitem_force(e, e.origin);
};
-void waypoint_spawnforteleporter(entity e, vector destination, float timetaken)
+void waypoint_spawnforteleporter_boxes(entity e, vector org1, vector org2, vector destination1, vector destination2, float timetaken)
{
local entity w;
local entity dw;
- w = waypoint_spawn(e.absmin, e.absmax, WAYPOINTFLAG_GENERATED | WAYPOINTFLAG_TELEPORT | WAYPOINTFLAG_NORELINK);
- dw = waypoint_spawn(destination, destination, WAYPOINTFLAG_GENERATED);
+ w = waypoint_spawn(org1, org2, WAYPOINTFLAG_GENERATED | WAYPOINTFLAG_TELEPORT | WAYPOINTFLAG_NORELINK);
+ dw = waypoint_spawn(destination1, destination2, WAYPOINTFLAG_GENERATED);
// one way link to the destination
w.wp00 = dw;
w.wp00mincost = timetaken; // this is just for jump pads
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)
{
entity w;