]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 0777f2cb63a457675fdc92ce4471d9b76b212232..64e960ff760f975a3ac36a9c7204ac6648978a82 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