From: terencehill Date: Thu, 16 Mar 2017 17:41:05 +0000 (+0100) Subject: Don't allow removal of hardwired waypoints in the editor X-Git-Tag: xonotic-v0.8.2~47 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=3ea922dd69aea306c1fb733a1adab7d3b9e9ec85;hp=ef7dd5e792e42d25f4ee94aaaf1be1b916a33f30 Don't allow removal of hardwired waypoints in the editor --- diff --git a/qcsrc/server/bot/api.qh b/qcsrc/server/bot/api.qh index fbf1a982c5..b3bc227300 100644 --- a/qcsrc/server/bot/api.qh +++ b/qcsrc/server/bot/api.qh @@ -44,6 +44,7 @@ float skill; .float wp24mincost, wp25mincost, wp26mincost, wp27mincost, wp28mincost, wp29mincost, wp30mincost, wp31mincost; .float wpconsidered; .float wpcost; +.float wphardwired; .int wpflags; bool bot_aim(entity this, .entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, float applygravity); diff --git a/qcsrc/server/impulse.qc b/qcsrc/server/impulse.qc index 6a5354aaff..a7f9554294 100644 --- a/qcsrc/server/impulse.qc +++ b/qcsrc/server/impulse.qc @@ -584,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); }