From: terencehill Date: Wed, 30 Aug 2017 12:24:27 +0000 (+0200) Subject: Fix nearest waypoint detection by restoring something I wrongly removed in d46494d5... X-Git-Tag: xonotic-v0.8.5~2378^2~75 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=334e55a4245606007f58884c3cde4fc4f4d3bc38;p=xonotic%2Fxonotic-data.pk3dir.git Fix nearest waypoint detection by restoring something I wrongly removed in d46494d5; minor fix: add a IS_PLAYER check --- diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 0777f2cb6..64e960ff7 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -766,6 +766,12 @@ entity navigation_findnearestwaypoint_withdist_except(entity ent, float walkfrom vector v = '0 0 0', v2 = '0 0 0'; float v2_height = 0; + if(ent.size && !IS_PLAYER(ent)) + { + org += 0.5 * (ent.mins + ent.maxs); + org.z = ent.origin.z + ent.mins.z - PL_MIN_CONST.z; // player height + } + if(!autocvar_g_waypointeditor && walkfromwp && !ent.navigation_dynamicgoal) { waypoint_clearlinks(ent); // initialize wpXXmincost fields