From bdfcadab2c8025cd6b8fd4e1f27c13463c8250af Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 3 May 2018 11:04:32 +0200 Subject: [PATCH] Set .nearestwaypoint for the player editing waypoints, useful to know details of the highlighted waypoint (with prvm_edictget) --- qcsrc/server/bot/default/waypoints.qc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/bot/default/waypoints.qc b/qcsrc/server/bot/default/waypoints.qc index ce7c69305..bc29b31da 100644 --- a/qcsrc/server/bot/default/waypoints.qc +++ b/qcsrc/server/bot/default/waypoints.qc @@ -456,7 +456,7 @@ float waypoint_getlinearcost(float dist) } float waypoint_getlinearcost_underwater(float dist) { - // NOTE: this value is hardcoded on the engine too, see SV_WaterMove + // NOTE: underwater speed factor is hardcoded in the engine too, see SV_WaterMove return dist / (autocvar_sv_maxspeed * 0.7); } @@ -1355,6 +1355,8 @@ void botframe_showwaypointlinks() { int display_type = 0; entity head = navigation_findnearestwaypoint(it, false); + it.nearestwaypoint = head; // mainly useful for debug + it.nearestwaypointtimeout = time + 2; // while I'm at it... if (IS_ONGROUND(it) || it.waterlevel > WATERLEVEL_NONE) display_type = 1; // default else if(head && (head.wphardwired)) -- 2.39.2