Fix nearest waypoint detection by restoring something I wrongly removed in d46494d5...
authorterencehill <piuntn@gmail.com>
Wed, 30 Aug 2017 12:24:27 +0000 (14:24 +0200)
committerterencehill <piuntn@gmail.com>
Wed, 30 Aug 2017 12:24:27 +0000 (14:24 +0200)
qcsrc/server/bot/default/navigation.qc

index 0777f2c..64e960f 100644 (file)
@@ -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