]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Set a more accurate destination z coord while walking
authorterencehill <piuntn@gmail.com>
Sat, 29 Jul 2017 14:36:45 +0000 (16:36 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 29 Jul 2017 14:36:45 +0000 (16:36 +0200)
qcsrc/server/bot/default/navigation.qh

index c188f53ac0b108b8a504a1479d8a5fc4d52cc456..a826715a86a9e46bc57b130a4a47c96960a72ffd 100644 (file)
@@ -49,14 +49,13 @@ entity navigation_bestgoal;
        waypoint_addlink_customcost(to_item, from_wp, waypoint_getlinkcost(from_wp, to_item))
 
 // if ent is a box waypoint or an item v is set to coords of ent that are closer to org
-// (but v.z is set to the middle coord of ent)
 #define SET_DESTCOORDS(ent, org, v) MACRO_BEGIN { \
        if ((ent.classname != "waypoint") || ent.wpisbox) { \
                vector wm1 = ent.origin + ent.mins; \
                vector wm2 = ent.origin + ent.maxs; \
                v.x = bound(wm1.x, org.x, wm2.x); \
                v.y = bound(wm1.y, org.y, wm2.y); \
-               v.z = (wm2.z - wm1.z) / 2; \
+               v.z = bound(wm1.z, org.z, wm2.z); \
        } else { \
                v = ent.origin; \
        } \