]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into terencehill/bot_waypoints
authorterencehill <piuntn@gmail.com>
Mon, 22 Oct 2018 15:38:04 +0000 (17:38 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 22 Oct 2018 15:38:04 +0000 (17:38 +0200)
qcsrc/common/mapobjects/trigger/jumppads.qc
qcsrc/server/bot/api.qh
qcsrc/server/bot/default/havocbot/havocbot.qc
qcsrc/server/bot/default/navigation.qc
qcsrc/server/bot/default/waypoints.qc
qcsrc/server/bot/default/waypoints.qh
qcsrc/server/bot/null/bot_null.qc
qcsrc/server/sv_main.qc

index ca1faeaf93c2ddd97e8c3ef052c3d770122cde26..a61935eb8c5633515f95924872fb9daa25a49ccf 100644 (file)
@@ -360,6 +360,10 @@ bool trigger_push_test(entity this, entity item)
                        if(t.move_movetype != MOVETYPE_NONE)
                                continue;
 
+                       // bots can't tell teamed jumppads from normal ones
+                       if (this.team)
+                               continue;
+
                        entity e = spawn();
                        setsize(e, PL_MIN_CONST, PL_MAX_CONST);
                        e.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
@@ -466,32 +470,41 @@ bool trigger_push_test(entity this, entity item)
                else if(n == 1)
                {
                        // exactly one dest - bots love that
-                       this.enemy = find(NULL, targetname, this.target);
+                       if (!this.team)
+                               this.enemy = find(NULL, targetname, this.target);
+                       else // bots can't tell teamed jumppads from normal ones
+                               this.enemy = NULL;
                }
                else
                {
                        // have to use random selection every single time
                        this.enemy = NULL;
                }
+
        }
 #ifdef SVQC
        else
        {
-               entity e = spawn();
-               setsize(e, PL_MIN_CONST, PL_MAX_CONST);
-               e.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
-               setorigin(e, org);
-               e.velocity = this.movedir;
-               tracetoss(e, e);
-               if (item)
+               if (!this.team)
                {
-                       bool r = (trace_ent == item);
+                       entity e = spawn();
+                       setsize(e, PL_MIN_CONST, PL_MAX_CONST);
+                       e.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
+                       setorigin(e, org);
+                       e.velocity = this.movedir;
+                       tracetoss(e, e);
+                       if (item)
+                       {
+                               bool r = (trace_ent == item);
+                               delete(e);
+                               return r;
+                       }
+                       if (!(boxesoverlap(this.absmin, this.absmax + eZ * 50, trace_endpos + PL_MIN_CONST, trace_endpos + PL_MAX_CONST)))
+                               waypoint_spawnforteleporter(this, trace_endpos, vlen(trace_endpos - org) / vlen(e.velocity), e);
                        delete(e);
-                       return r;
                }
-               if (!(boxesoverlap(this.absmin, this.absmax + eZ * 50, trace_endpos + PL_MIN_CONST, trace_endpos + PL_MAX_CONST)))
-                       waypoint_spawnforteleporter(this, trace_endpos, vlen(trace_endpos - org) / vlen(e.velocity), e);
-               delete(e);
+               else if (item)
+                       return false;
        }
 
        defer(this, 0.1, trigger_push_updatelink);
index 0cddd3b27a01df165978105a753016033b7b5c1c..11e0707e989e3ab5e344825b1cdc742103678e81 100644 (file)
@@ -13,6 +13,7 @@ const int WAYPOINTFLAG_PROTECTED = BIT(18);  // Useless WP detection never kills
 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;
@@ -118,7 +119,7 @@ void waypoint_schedulerelink(entity wp);
 void waypoint_spawnforitem(entity e);
 void waypoint_spawnforitem_force(entity e, vector org);
 void waypoint_spawnforteleporter(entity e, vector destination, float timetaken, entity tracetest_ent);
-void waypoint_spawnforteleporter_wz(entity e, vector org, vector destination, float timetaken, vector down_dir, entity tracetest_ent);
+void waypoint_spawnforteleporter_wz(entity e, entity tracetest_ent);
 void waypoint_spawn_fromeditor(entity pl);
 entity waypoint_spawn(vector m1, vector m2, float f);
 void waypoint_unreachable(entity pl);
index 63f1e0179442941435d9dfc6aeb30ef6e8c9d8c4..17a7c29ef8a5029231a9f1f90ec328ac761db79d 100644 (file)
@@ -779,7 +779,9 @@ void havocbot_movetogoal(entity this)
        {
                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;
@@ -961,8 +963,16 @@ void havocbot_movetogoal(entity this)
                        {
                                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
index 250b7cb09c639e45680e699514958d769b97a686..8fe72ff6377d6690480eb61c7f6121e44a5cd32d 100644 (file)
@@ -1608,6 +1608,16 @@ int navigation_poptouchedgoals(entity this)
 
        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))
index c8e723260078ef33aab9cd3e818286c5a1048f36..8fc4829a5d2a4bfb75084619c7c8c9feb376f764 100644 (file)
@@ -358,52 +358,65 @@ void waypoint_removelink(entity from, entity to)
        if (from == to || (from.wpflags & WAYPOINTFLAG_NORELINK))
                return;
 
-       bool found = false;
-       if (!found && from.wp00 == to) found = true; if (found) {from.wp00 = from.wp01; from.wp00mincost = from.wp01mincost;}
-       if (!found && from.wp01 == to) found = true; if (found) {from.wp01 = from.wp02; from.wp01mincost = from.wp02mincost;}
-       if (!found && from.wp02 == to) found = true; if (found) {from.wp02 = from.wp03; from.wp02mincost = from.wp03mincost;}
-       if (!found && from.wp03 == to) found = true; if (found) {from.wp03 = from.wp04; from.wp03mincost = from.wp04mincost;}
-       if (!found && from.wp04 == to) found = true; if (found) {from.wp04 = from.wp05; from.wp04mincost = from.wp05mincost;}
-       if (!found && from.wp05 == to) found = true; if (found) {from.wp05 = from.wp06; from.wp05mincost = from.wp06mincost;}
-       if (!found && from.wp06 == to) found = true; if (found) {from.wp06 = from.wp07; from.wp06mincost = from.wp07mincost;}
-       if (!found && from.wp07 == to) found = true; if (found) {from.wp07 = from.wp08; from.wp07mincost = from.wp08mincost;}
-       if (!found && from.wp08 == to) found = true; if (found) {from.wp08 = from.wp09; from.wp08mincost = from.wp09mincost;}
-       if (!found && from.wp09 == to) found = true; if (found) {from.wp09 = from.wp10; from.wp09mincost = from.wp10mincost;}
-       if (!found && from.wp10 == to) found = true; if (found) {from.wp10 = from.wp11; from.wp10mincost = from.wp11mincost;}
-       if (!found && from.wp11 == to) found = true; if (found) {from.wp11 = from.wp12; from.wp11mincost = from.wp12mincost;}
-       if (!found && from.wp12 == to) found = true; if (found) {from.wp12 = from.wp13; from.wp12mincost = from.wp13mincost;}
-       if (!found && from.wp13 == to) found = true; if (found) {from.wp13 = from.wp14; from.wp13mincost = from.wp14mincost;}
-       if (!found && from.wp14 == to) found = true; if (found) {from.wp14 = from.wp15; from.wp14mincost = from.wp15mincost;}
-       if (!found && from.wp15 == to) found = true; if (found) {from.wp15 = from.wp16; from.wp15mincost = from.wp16mincost;}
-       if (!found && from.wp16 == to) found = true; if (found) {from.wp16 = from.wp17; from.wp16mincost = from.wp17mincost;}
-       if (!found && from.wp17 == to) found = true; if (found) {from.wp17 = from.wp18; from.wp17mincost = from.wp18mincost;}
-       if (!found && from.wp18 == to) found = true; if (found) {from.wp18 = from.wp19; from.wp18mincost = from.wp19mincost;}
-       if (!found && from.wp19 == to) found = true; if (found) {from.wp19 = from.wp20; from.wp19mincost = from.wp20mincost;}
-       if (!found && from.wp20 == to) found = true; if (found) {from.wp20 = from.wp21; from.wp20mincost = from.wp21mincost;}
-       if (!found && from.wp21 == to) found = true; if (found) {from.wp21 = from.wp22; from.wp21mincost = from.wp22mincost;}
-       if (!found && from.wp22 == to) found = true; if (found) {from.wp22 = from.wp23; from.wp22mincost = from.wp23mincost;}
-       if (!found && from.wp23 == to) found = true; if (found) {from.wp23 = from.wp24; from.wp23mincost = from.wp24mincost;}
-       if (!found && from.wp24 == to) found = true; if (found) {from.wp24 = from.wp25; from.wp24mincost = from.wp25mincost;}
-       if (!found && from.wp25 == to) found = true; if (found) {from.wp25 = from.wp26; from.wp25mincost = from.wp26mincost;}
-       if (!found && from.wp26 == to) found = true; if (found) {from.wp26 = from.wp27; from.wp26mincost = from.wp27mincost;}
-       if (!found && from.wp27 == to) found = true; if (found) {from.wp27 = from.wp28; from.wp27mincost = from.wp28mincost;}
-       if (!found && from.wp28 == to) found = true; if (found) {from.wp28 = from.wp29; from.wp28mincost = from.wp29mincost;}
-       if (!found && from.wp29 == to) found = true; if (found) {from.wp29 = from.wp30; from.wp29mincost = from.wp30mincost;}
-       if (!found && from.wp30 == to) found = true; if (found) {from.wp30 = from.wp31; from.wp30mincost = from.wp31mincost;}
-       if (found) {from.wp31 = NULL; from.wp31mincost = 10000000;}
+       entity fromwp31_prev = from.wp31;
+
+       switch (waypoint_getlinknum(from, to))
+       {
+               // fallthrough all the way
+               case 00: from.wp00 = from.wp01; from.wp00mincost = from.wp01mincost;
+               case 01: from.wp01 = from.wp02; from.wp01mincost = from.wp02mincost;
+               case 02: from.wp02 = from.wp03; from.wp02mincost = from.wp03mincost;
+               case 03: from.wp03 = from.wp04; from.wp03mincost = from.wp04mincost;
+               case 04: from.wp04 = from.wp05; from.wp04mincost = from.wp05mincost;
+               case 05: from.wp05 = from.wp06; from.wp05mincost = from.wp06mincost;
+               case 06: from.wp06 = from.wp07; from.wp06mincost = from.wp07mincost;
+               case 07: from.wp07 = from.wp08; from.wp07mincost = from.wp08mincost;
+               case 08: from.wp08 = from.wp09; from.wp08mincost = from.wp09mincost;
+               case 09: from.wp09 = from.wp10; from.wp09mincost = from.wp10mincost;
+               case 10: from.wp10 = from.wp11; from.wp10mincost = from.wp11mincost;
+               case 11: from.wp11 = from.wp12; from.wp11mincost = from.wp12mincost;
+               case 12: from.wp12 = from.wp13; from.wp12mincost = from.wp13mincost;
+               case 13: from.wp13 = from.wp14; from.wp13mincost = from.wp14mincost;
+               case 14: from.wp14 = from.wp15; from.wp14mincost = from.wp15mincost;
+               case 15: from.wp15 = from.wp16; from.wp15mincost = from.wp16mincost;
+               case 16: from.wp16 = from.wp17; from.wp16mincost = from.wp17mincost;
+               case 17: from.wp17 = from.wp18; from.wp17mincost = from.wp18mincost;
+               case 18: from.wp18 = from.wp19; from.wp18mincost = from.wp19mincost;
+               case 19: from.wp19 = from.wp20; from.wp19mincost = from.wp20mincost;
+               case 20: from.wp20 = from.wp21; from.wp20mincost = from.wp21mincost;
+               case 21: from.wp21 = from.wp22; from.wp21mincost = from.wp22mincost;
+               case 22: from.wp22 = from.wp23; from.wp22mincost = from.wp23mincost;
+               case 23: from.wp23 = from.wp24; from.wp23mincost = from.wp24mincost;
+               case 24: from.wp24 = from.wp25; from.wp24mincost = from.wp25mincost;
+               case 25: from.wp25 = from.wp26; from.wp25mincost = from.wp26mincost;
+               case 26: from.wp26 = from.wp27; from.wp26mincost = from.wp27mincost;
+               case 27: from.wp27 = from.wp28; from.wp27mincost = from.wp28mincost;
+               case 28: from.wp28 = from.wp29; from.wp28mincost = from.wp29mincost;
+               case 29: from.wp29 = from.wp30; from.wp29mincost = from.wp30mincost;
+               case 30: from.wp30 = from.wp31; from.wp30mincost = from.wp31mincost;
+               case 31: from.wp31 = NULL; from.wp31mincost = 10000000;
+       }
+
+       if (fromwp31_prev && !from.wp31)
+               waypoint_schedulerelink(from);
+}
+
+int waypoint_getlinknum(entity from, entity to)
+{
+       if (from.wp00 == to) return 00; if (from.wp01 == to) return 01; if (from.wp02 == to) return 02; if (from.wp03 == to) return 03;
+       if (from.wp04 == to) return 04; if (from.wp05 == to) return 05; if (from.wp06 == to) return 06; if (from.wp07 == to) return 07;
+       if (from.wp08 == to) return 08; if (from.wp09 == to) return 09; if (from.wp10 == to) return 10; if (from.wp11 == to) return 11;
+       if (from.wp12 == to) return 12; if (from.wp13 == to) return 13; if (from.wp14 == to) return 14; if (from.wp15 == to) return 15;
+       if (from.wp16 == to) return 16; if (from.wp17 == to) return 17; if (from.wp18 == to) return 18; if (from.wp19 == to) return 19;
+       if (from.wp20 == to) return 20; if (from.wp21 == to) return 21; if (from.wp22 == to) return 22; if (from.wp23 == to) return 23;
+       if (from.wp24 == to) return 24; if (from.wp25 == to) return 25; if (from.wp26 == to) return 26; if (from.wp27 == to) return 27;
+       if (from.wp28 == to) return 28; if (from.wp29 == to) return 29; if (from.wp30 == to) return 30; if (from.wp31 == to) return 31;
+       return -1;
 }
 
 bool waypoint_islinked(entity from, entity to)
 {
-       if (from.wp00 == to) return true;if (from.wp01 == to) return true;if (from.wp02 == to) return true;if (from.wp03 == to) return true;
-       if (from.wp04 == to) return true;if (from.wp05 == to) return true;if (from.wp06 == to) return true;if (from.wp07 == to) return true;
-       if (from.wp08 == to) return true;if (from.wp09 == to) return true;if (from.wp10 == to) return true;if (from.wp11 == to) return true;
-       if (from.wp12 == to) return true;if (from.wp13 == to) return true;if (from.wp14 == to) return true;if (from.wp15 == to) return true;
-       if (from.wp16 == to) return true;if (from.wp17 == to) return true;if (from.wp18 == to) return true;if (from.wp19 == to) return true;
-       if (from.wp20 == to) return true;if (from.wp21 == to) return true;if (from.wp22 == to) return true;if (from.wp23 == to) return true;
-       if (from.wp24 == to) return true;if (from.wp25 == to) return true;if (from.wp26 == to) return true;if (from.wp27 == to) return true;
-       if (from.wp28 == to) return true;if (from.wp29 == to) return true;if (from.wp30 == to) return true;if (from.wp31 == to) return true;
-       return false;
+       return (waypoint_getlinknum(from, to) >= 0);
 }
 
 void waypoint_updatecost_foralllinks()
@@ -902,7 +915,7 @@ void waypoint_load_or_remove_links_hardwired(bool removal_mode)
                        if(!found)
                        {
                                if(!removal_mode)
-                                       LOG_INFO("NOTICE: Can not find waypoint at ", vtos(wp_from_pos), ". Path skipped");
+                                       LOG_INFO("NOTICE: Can not find origin waypoint for the hardwired link ", s, ". Path skipped");
                                continue;
                        }
                }
@@ -924,7 +937,7 @@ void waypoint_load_or_remove_links_hardwired(bool removal_mode)
                if(!found)
                {
                        if(!removal_mode)
-                               LOG_INFO("NOTICE: Can not find waypoint at ", vtos(wp_to_pos), ". Path skipped");
+                               LOG_INFO("NOTICE: Can not find destination waypoint for the hardwired link ", s, ". Path skipped");
                        continue;
                }
 
@@ -1285,19 +1298,42 @@ void waypoint_spawnforteleporter_boxes(entity e, int teleport_flag, vector org1,
        e.nearestwaypointtimeout = -1;
 }
 
-void waypoint_spawnforteleporter_wz(entity e, vector org, vector destination, float timetaken, vector down_dir, entity tracetest_ent)
+void waypoint_spawnforteleporter_wz(entity e, entity tracetest_ent)
 {
-       // warpzones with oblique warp plane rely on down_dir to snap waypoints
-       // to the ground without leaving the warp plane
-       // warpzones with horizontal warp plane (down_dir.x == -1) generate
-       // destination waypoint snapped to the ground (leaving warpzone), source
-       // waypoint in the center of the warp plane
-       if(down_dir.x != -1)
-               org = waypoint_fixorigin_down_dir(org, tracetest_ent, down_dir);
-       if(down_dir.x == -1)
-               down_dir = '0 0 -1';
-       destination = waypoint_fixorigin_down_dir(destination, tracetest_ent, down_dir);
-       waypoint_spawnforteleporter_boxes(e, WAYPOINTFLAG_TELEPORT, org, org, destination, destination, timetaken);
+       float src_angle = e.warpzone_angles.x;
+       while (src_angle < -180) src_angle += 360;
+       while (src_angle > 180) src_angle -= 360;
+
+       float dest_angle = e.enemy.warpzone_angles.x;
+       while (dest_angle < -180) dest_angle += 360;
+       while (dest_angle > 180) dest_angle -= 360;
+
+       // no waypoints for warpzones pointing upwards, they can't be used by the bots
+       if (src_angle == -90 || dest_angle == -90)
+               return;
+
+       makevectors(e.warpzone_angles);
+       vector src = (e.absmin + e.absmax) * 0.5;
+       src += ((e.warpzone_origin - src) * v_forward) * v_forward + 16 * v_right;
+       vector down_dir_src = -v_up;
+
+       makevectors(e.enemy.warpzone_angles);
+       vector dest = (e.enemy.absmin + e.enemy.absmax) * 0.5;
+       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 | extra_flag, src, src, dest, dest, 0);
 }
 
 void waypoint_spawnforteleporter(entity e, vector destination, float timetaken, entity tracetest_ent)
index 34372fe9661f535439b4c815cb6ef5c632dac6c8..1de3d449018d19cb4aae2cab101e864b595bf312 100644 (file)
@@ -6,7 +6,7 @@
 // increase by 0.01 when changes require only waypoint relinking
 // increase by 1 when changes require to manually edit waypoints
 // max 2 decimal places, always specified
-const float WAYPOINT_VERSION = 1.01;
+const float WAYPOINT_VERSION = 1.02;
 string waypoint_time;
 
 // fields you can query using prvm_global server to get some statistics about waypoint linking culling
@@ -37,6 +37,7 @@ float botframe_cachedwaypointlinks;
 
 spawnfunc(waypoint);
 void waypoint_removelink(entity from, entity to);
+int waypoint_getlinknum(entity from, entity to);
 bool waypoint_islinked(entity from, entity to);
 void waypoint_addlink_customcost(entity from, entity to, float c);
 void waypoint_addlink(entity from, entity to);
@@ -58,7 +59,7 @@ void waypoint_saveall();
 void waypoint_spawnforitem_force(entity e, vector org);
 void waypoint_spawnforitem(entity e);
 void waypoint_spawnforteleporter(entity e, vector destination, float timetaken, entity tracetest_ent);
-void waypoint_spawnforteleporter_wz(entity e, vector org, vector destination, float timetaken, vector down_dir, entity tracetest_ent);
+void waypoint_spawnforteleporter_wz(entity e, entity tracetest_ent);
 void botframe_showwaypointlinks();
 
 float waypoint_loadall();
index f8738f80fb5cdc855eda4bd6bb9ad351ddf9d5cb..bdca146c2e549128e2e208fec27f8b118e091af4 100644 (file)
@@ -38,7 +38,7 @@ void waypoint_schedulerelink(entity wp) { }
 void waypoint_spawnforitem(entity e) { }
 void waypoint_spawnforitem_force(entity e, vector org) { }
 void waypoint_spawnforteleporter(entity e, vector destination, float timetaken, entity tracetest_ent) { }
-void waypoint_spawnforteleporter_wz(entity e, vector org, vector destination, float timetaken, vector down_dir, entity tracetest_ent) { }
+void waypoint_spawnforteleporter_wz(entity e, entity tracetest_ent) { }
 void waypoint_spawn_fromeditor(entity pl) { }
 entity waypoint_spawn(vector m1, vector m2, float f) { return NULL; }
 #endif
index 539b30d294ce0c68e43e80d81f9b0d7732353199..a92a4ea12fee403b9cd2904aa4b7786ec280b3f4 100644 (file)
@@ -372,16 +372,7 @@ void WarpZone_PostInitialize_Callback()
        tracetest_ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
        //for(entity e = warpzone_first; e; e = e.warpzone_next)
        for(entity e = NULL; (e = find(e, classname, "trigger_warpzone")); )
-       {
-               vector src, dst;
-               src = (e.absmin + e.absmax) * 0.5;
-               makevectors(e.warpzone_angles);
-               src = src + ((e.warpzone_origin - src) * v_forward) * v_forward + 16 * v_right;
-               dst = (e.enemy.absmin + e.enemy.absmax) * 0.5;
-               makevectors(e.enemy.warpzone_angles);
-               dst = dst + ((e.enemy.warpzone_origin - dst) * v_forward) * v_forward - 16 * v_right;
-               waypoint_spawnforteleporter_wz(e, src, dst, 0, -v_up, tracetest_ent);
-       }
+               waypoint_spawnforteleporter_wz(e, tracetest_ent);
        delete(tracetest_ent);
 }