From 54ec41b3a35691589815cd9a2e259473494745c3 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Fri, 9 Jan 2015 07:13:14 -0800 Subject: [PATCH] Minor autowaypointer fixes. --- qcsrc/server/bot/navigation.qc | 2 +- qcsrc/server/bot/waypoints.qc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/qcsrc/server/bot/navigation.qc b/qcsrc/server/bot/navigation.qc index 001617722..0f4c330ed 100644 --- a/qcsrc/server/bot/navigation.qc +++ b/qcsrc/server/bot/navigation.qc @@ -430,7 +430,7 @@ entity navigation_findnearestwaypoint(entity ent, float walkfromwp) if (autocvar_g_waypointeditor_auto) { entity wp2 = navigation_findnearestwaypoint_withdist_except(ent, walkfromwp, 1050, wp); - if (!wp2) + if (wp && !wp2) wp.wpflags |= WAYPOINTFLAG_PROTECTED; } return wp; diff --git a/qcsrc/server/bot/waypoints.qc b/qcsrc/server/bot/waypoints.qc index da0b35089..4118b6b76 100644 --- a/qcsrc/server/bot/waypoints.qc +++ b/qcsrc/server/bot/waypoints.qc @@ -1141,6 +1141,7 @@ void botframe_autowaypoints() //te_explosion(p.botframe_autowaypoints_lastwp0.origin); } - botframe_deleteuselesswaypoints(); + // TODO(divVerent): For some reason this always removes newly created WPs. Need to figure out why. + //botframe_deleteuselesswaypoints(); } -- 2.39.2