]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix cost of travel from jumppad to item
authorterencehill <piuntn@gmail.com>
Fri, 27 Oct 2017 19:10:57 +0000 (21:10 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 27 Oct 2017 19:10:57 +0000 (21:10 +0200)
qcsrc/server/bot/default/navigation.qc

index 08e1cffe23d94bf544ff9b864ff2bba8fd22705a..61079576a90c190b5ae94b1553f25ef7b7ac4d85 100644 (file)
@@ -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), ")");