From: terencehill Date: Thu, 3 May 2018 09:04:32 +0000 (+0200) Subject: Set .nearestwaypoint for the player editing waypoints, useful to know details of... X-Git-Tag: xonotic-v0.8.5~2152 X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=bdfcadab2c8025cd6b8fd4e1f27c13463c8250af Set .nearestwaypoint for the player editing waypoints, useful to know details of the highlighted waypoint (with prvm_edictget) --- 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))