- 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);
+
+ // snap to the ground only if source warpzone isn't horizontal
+ if(down_dir_src.x != -1)
+ src = waypoint_fixorigin_down_dir(src, tracetest_ent, down_dir_src);
+ if(down_dir_dest.x == -1) // horizontal
+ down_dir_dest = '0 0 -1'; // change to vertical
+ destination = waypoint_fixorigin_down_dir(destination, tracetest_ent, down_dir_dest);
+
+ waypoint_spawnforteleporter_boxes(e, WAYPOINTFLAG_TELEPORT, src, src, destination, destination, timetaken);