]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use waypoint origin, not player origin
authorterencehill <piuntn@gmail.com>
Sun, 19 Mar 2017 16:00:12 +0000 (17:00 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 19 Mar 2017 16:00:12 +0000 (17:00 +0100)
qcsrc/server/impulse.qc

index 0741756767c4d2648c6b53fe881d138b79e8228f..7852620cf880939face7e5d9c70210b73a560ed2 100644 (file)
@@ -574,16 +574,18 @@ IMPULSE(waypoint_clear)
 IMPULSE(navwaypoint_spawn)
 {
        if (!autocvar_g_waypointeditor) return;
+       entity e;
        vector org = this.origin;
        bool sym = boolean(autocvar_g_waypointeditor_symmetrical);
 
        LABEL(add_wp);
-       waypoint_schedulerelink(waypoint_spawn(org, org, 0));
+       e = waypoint_spawn(org, org, 0);
+       waypoint_schedulerelink(e);
        bprint(strcat("Waypoint spawned at ", vtos(org), "\n"));
        if(sym)
        {
                vector map_center = autocvar_g_waypointeditor_symmetrical_center;
-               org = this.origin;
+               org = e.origin;
                org.x = map_center.x - (org.x - map_center.x);
                org.y = map_center.y - (org.y - map_center.y);
                if (vdist(org - this.origin, >, 10))
@@ -614,7 +616,7 @@ IMPULSE(navwaypoint_remove)
        if (sym)
        {
                vector map_center = autocvar_g_waypointeditor_symmetrical_center;
-               vector org = this.origin;
+               vector org = e.origin;
                org.x = map_center.x - (org.x - map_center.x);
                org.y = map_center.y - (org.y - map_center.y);
                FOREACH_ENTITY_CLASS("waypoint", !(it.wpflags & WAYPOINTFLAG_GENERATED), {