From: terencehill Date: Sat, 29 Jul 2017 14:36:45 +0000 (+0200) Subject: Set a more accurate destination z coord while walking X-Git-Tag: xonotic-v0.8.5~2378^2~109 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f24a84f25bae1ebc136a34f3fe3e87262e23062b;p=xonotic%2Fxonotic-data.pk3dir.git Set a more accurate destination z coord while walking --- diff --git a/qcsrc/server/bot/default/navigation.qh b/qcsrc/server/bot/default/navigation.qh index c188f53ac..a826715a8 100644 --- a/qcsrc/server/bot/default/navigation.qh +++ b/qcsrc/server/bot/default/navigation.qh @@ -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; \ } \