From: terencehill Date: Fri, 27 Oct 2017 19:10:57 +0000 (+0200) Subject: Fix cost of travel from jumppad to item X-Git-Tag: xonotic-v0.8.5~2378^2~37 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6ce600175045fb694c6cff8b297c5fd83e7c9ce9;p=xonotic%2Fxonotic-data.pk3dir.git Fix cost of travel from jumppad to item --- diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 08e1cffe2..61079576a 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -1261,11 +1261,15 @@ void navigation_routerating(entity this, entity e, float f, float rangebias) } LOG_DEBUG("-- checking ", e.classname, " (with cost ", ftos(nwp.wpcost), ")"); - if (nwp) - if (nwp.wpcost < 10000000) + if (nwp && nwp.wpcost < 10000000) { //te_wizspike(nwp.wpnearestpoint); - float cost = nwp.wpcost + waypoint_gettravelcost(nwp.wpnearestpoint, goal_org, nwp, e); + float nwptoitem_cost = 0; + if(nwp.wpflags & WAYPOINTFLAG_TELEPORT) + nwptoitem_cost = nwp.wp00mincost; + else + nwptoitem_cost = waypoint_gettravelcost(nwp.wpnearestpoint, goal_org, nwp, e); + float cost = nwp.wpcost + nwptoitem_cost; LOG_DEBUG(e.classname, " ", ftos(f), "/(1+", ftos(cost), "/", ftos(rangebias), ") = "); f = f * rangebias / (rangebias + cost); LOG_DEBUG("considering ", e.classname, " (with rating ", ftos(f), ")");