const int WAYPOINTFLAG_USEFUL = BIT(17); // Useless WP detection temporary flag.
const int WAYPOINTFLAG_DEAD_END = BIT(16); // Useless WP detection temporary flag.
const int WAYPOINTFLAG_LADDER = BIT(15);
+const int WAYPOINTFLAG_JUMP = BIT(14);
entity kh_worldkeylist;
.entity kh_worldkeynext;
{
if (vdist(this.origin - this.goalcurrent_prev.origin, <, 50)
&& navigation_goalrating_timeout_can_be_anticipated(this))
+ {
navigation_goalrating_timeout_force(this);
+ }
}
bool goalcurrent_can_be_removed = false;
{
if (vlen2(flat_diff) < vlen2(offset))
{
- actual_destorg.x = destorg.x;
- actual_destorg.y = destorg.y;
+ if (this.goalcurrent.wpflags & WAYPOINTFLAG_JUMP && this.goalstack01)
+ {
+ // oblique warpzones need a jump otherwise bots gets stuck
+ PHYS_INPUT_BUTTON_JUMP(this) = true;
+ }
+ else
+ {
+ actual_destorg.x = destorg.x;
+ actual_destorg.y = destorg.y;
+ }
}
}
else if (vdist(flat_diff, <, 32) && diff.z < -16) // destination is under the bot
if(this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT)
{
+ if (!this.goalcurrent.wpisbox // warpzone
+ && vlen2(this.origin - this.goalstack01.origin) < vlen2(this.origin - this.goalcurrent.origin))
+ {
+ navigation_poproute(this);
+ ++removed_goals;
+ navigation_poproute(this);
+ ++removed_goals;
+ return removed_goals;
+ }
+
// make sure jumppad is really hit, don't rely on distance based checks
// as they may report a touch even if it didn't really happen
if(this.lastteleporttime > 0 && TELEPORT_USED(this, this.goalcurrent))
dest += ((e.enemy.warpzone_origin - dest) * v_forward) * v_forward - 16 * v_right;
vector down_dir_dest = -v_up;
+ int extra_flag = 0;
// don't snap to the ground waypoints for source warpzones pointing downwards
if (src_angle != 90)
{
src = waypoint_fixorigin_down_dir(src, tracetest_ent, down_dir_src);
dest = waypoint_fixorigin_down_dir(dest, tracetest_ent, down_dir_dest);
+ // oblique warpzones need a jump otherwise bots gets stuck
+ if (src_angle != 0)
+ extra_flag = WAYPOINTFLAG_JUMP;
}
- waypoint_spawnforteleporter_boxes(e, WAYPOINTFLAG_TELEPORT, src, src, dest, dest, 0);
+ waypoint_spawnforteleporter_boxes(e, WAYPOINTFLAG_TELEPORT | extra_flag, src, src, dest, dest, 0);
}
void waypoint_spawnforteleporter(entity e, vector destination, float timetaken, entity tracetest_ent)