this.aistatus &= ~AI_STATUS_OUT_JUMPPAD;
}
}
- else
+ else //if (this.goalcurrent)
{
if (this.goalcurrent.bot_pickup)
{
return;
}
}
- else
+ else //if (!(this.aistatus & AI_STATUS_OUT_JUMPPAD))
{
- if(time - this.lastteleporttime > 0.2 && this.velocity.z > 0)
+ if(this.origin.z - this.lastteleport_origin.z > (this.maxs.z - this.mins.z) * 0.5)
{
vector velxy = this.velocity; velxy_z = 0;
if(vdist(velxy, <, autocvar_sv_maxspeed * 0.2))
if (!this.goalcurrent.wpisbox // warpzone
&& vlen2(this.origin - this.goalstack01.origin) < vlen2(this.origin - this.goalcurrent.origin))
{
+ // immediately remove origin and destination waypoints
navigation_poproute(this);
++removed_goals;
navigation_poproute(this);
++removed_goals;
- return removed_goals;
+ this.lastteleporttime = 0;
}
// make sure jumppad is really hit, don't rely on distance based checks
if (time - this.lastteleporttime < random() * max_delay)
return removed_goals;
}
+ else if (this.goalcurrent.wpisbox) // teleport
+ {
+ // immediately remove origin and destination waypoints
+ navigation_poproute(this);
+ ++removed_goals;
+ }
navigation_poproute(this);
this.lastteleporttime = 0;
++removed_goals;
}
- else
- return removed_goals;
+ return removed_goals;
}
else if (this.lastteleporttime > 0)
{
++removed_goals;
return removed_goals;
}
+ // reset of lastteleporttime can be overriden by a jumppad when it's set
+ // in more than one frame: make sure it's reset
+ this.lastteleporttime = 0;
}
// Loose goal touching check when running
waypoint_addlink_customcost(to_item, from_wp, waypoint_getlinkcost(from_wp, to_item))
#define TELEPORT_USED(pl, tele_wp) \
- (time - pl.lastteleporttime < ((tele_wp.wpflags & WAYPOINTFLAG_PERSONAL) ? 2 : 0.15) \
- && boxesoverlap(tele_wp.absmin, tele_wp.absmax, pl.lastteleport_origin + STAT(PL_MIN, pl), pl.lastteleport_origin + STAT(PL_MAX, pl)))
+ boxesoverlap(tele_wp.absmin, tele_wp.absmax, pl.lastteleport_origin + STAT(PL_MIN, pl), pl.lastteleport_origin + STAT(PL_MAX, pl))
vector tracewalk_dest;
float tracewalk_dest_height;