]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/impulse.qc
Don't allow removal of hardwired waypoints in the editor
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / impulse.qc
index 57aaf4a2b51ae1208470cc4bdf3a3deeca573624..a7f9554294fc40ad246505743f4721a6b194b199 100644 (file)
@@ -551,6 +551,9 @@ IMPULSE(waypoint_clear_personal)
        {
                delete(this.personal);
                this.personal = NULL;
+
+               if((g_cts || g_race) && autocvar_g_allow_checkpoints)
+                       ClientKill(this);
        }
        sprint(this, "personal waypoint cleared\n");
 }
@@ -562,6 +565,8 @@ IMPULSE(waypoint_clear)
        {
                delete(this.personal);
                this.personal = NULL;
+               if((g_cts || g_race) && autocvar_g_allow_checkpoints)
+                       ClientKill(this);
        }
        sprint(this, "all waypoints cleared\n");
 }
@@ -579,6 +584,13 @@ IMPULSE(navwaypoint_remove)
        entity e = navigation_findnearestwaypoint(this, false);
        if (!e) return;
        if (e.wpflags & WAYPOINTFLAG_GENERATED) return;
+
+       if (e.wphardwired)
+       {
+               LOG_INFO("^1Warning: ^7Removal of hardwired waypoints is not allowed in the editor. Please remove links from/to this waypoint (", vtos(e.origin), ") by hand from maps/", mapname, ".waypoints.hardwired\n");
+               return;
+       }
+
        bprint(strcat("Waypoint removed at ", vtos(e.origin), "\n"));
        waypoint_remove(e);
 }