]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Rename 2 functions
authorterencehill <piuntn@gmail.com>
Sun, 21 May 2017 09:36:20 +0000 (11:36 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 21 May 2017 09:36:20 +0000 (11:36 +0200)
qcsrc/common/triggers/func/ladder.qc
qcsrc/server/bot/default/navigation.qc
qcsrc/server/bot/default/waypoints.qc
qcsrc/server/bot/default/waypoints.qh

index c8cebc112d18dae8cacec45dfb100340bbaaa987..d93b77b572e46a9d3a014592ffb71bd36bfbde80 100644 (file)
@@ -51,7 +51,7 @@ void func_ladder_init(entity this)
        this.bot_pickup = true; // allow bots to make use of this ladder
        vector top = (this.absmin + this.absmax) / 2;
        top.z = this.absmax.z + 1 - PL_MIN_CONST.z;
-       float cost = waypoint_getdistancecost_simple(this.absmax.z - this.absmin.z);
+       float cost = waypoint_getlinearcost(this.absmax.z - this.absmin.z);
        waypoint_spawnforteleporter_boxes(this, WAYPOINTFLAG_LADDER, this.absmin, this.absmax, top, top, cost);
 }
 
index c31a62860c14a5c0d52767a6c806407fda6cd322..5672b110167ea68017f552279735807c5c7e100c 100644 (file)
@@ -534,7 +534,7 @@ float navigation_markroutes_nearestwaypoints(entity this, float maxdist)
                        if (tracewalk(this, this.origin, this.mins, this.maxs, v, v_height, bot_navigation_movemode))
                        {
                                it.wpnearestpoint = v;
-                               it.wpcost = waypoint_getdistancecost(this.origin, v) + it.dmg;
+                               it.wpcost = waypoint_gettravelcost(this.origin, v) + it.dmg;
                                it.wpfire = 1;
                                it.enemy = NULL;
                                c = c + 1;
@@ -564,7 +564,7 @@ void navigation_markroutes_checkwaypoint(entity w, entity wp, float cost, vector
        if (w.wpflags & WAYPOINTFLAG_TELEPORT)
                cost += w.wp00mincost; // assuming teleport has exactly one destination
        else
-               cost += waypoint_getdistancecost(p, v);
+               cost += waypoint_gettravelcost(p, v);
        if (wp.wpcost > cost)
        {
                wp.wpcost = cost;
@@ -722,8 +722,8 @@ void navigation_routerating(entity this, entity e, float f, float rangebias)
        if(e.blacklisted)
                return;
 
-       rangebias = waypoint_getdistancecost_simple(rangebias);
-       f = waypoint_getdistancecost_simple(f);
+       rangebias = waypoint_getlinearcost(rangebias);
+       f = waypoint_getlinearcost(f);
 
        if (IS_PLAYER(e))
        {
@@ -925,7 +925,7 @@ void navigation_routerating(entity this, entity e, float f, float rangebias)
        if (nwp.wpcost < 10000000)
        {
                //te_wizspike(nwp.wpnearestpoint);
-               float cost = nwp.wpcost + waypoint_getdistancecost(nwp.wpnearestpoint, goal_org);
+               float cost = nwp.wpcost + waypoint_gettravelcost(nwp.wpnearestpoint, goal_org);
                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), ")");
@@ -1162,7 +1162,7 @@ void botframe_updatedangerousobjects(float maxupdate)
                        v.y = bound(m1_y, v.y, m2_y);
                        v.z = bound(m1_z, v.z, m2_z);
                        o = (it.absmin + it.absmax) * 0.5;
-                       d = waypoint_getdistancecost_simple(it.bot_dodgerating) - waypoint_getdistancecost(o, v);
+                       d = waypoint_getlinearcost(it.bot_dodgerating) - waypoint_gettravelcost(o, v);
                        if (d > 0)
                        {
                                traceline(o, v, true, NULL);
index f058217dc16a236aa25e39435fbff0b8f7083fad..f801052931068723de996146058a160e8cbf936b 100644 (file)
@@ -437,22 +437,22 @@ void waypoint_updatecost_foralllinks()
        });
 }
 
-float waypoint_getdistancecost_simple(float dist)
+float waypoint_getlinearcost(float dist)
 {
        if(skill >= autocvar_bot_ai_bunnyhop_skilloffset)
                return dist / (autocvar_sv_maxspeed * 1.25);
        return dist / autocvar_sv_maxspeed;
 }
 
-float waypoint_getdistancecost(vector from, vector to)
+float waypoint_gettravelcost(vector from, vector to)
 {
-       float c = waypoint_getdistancecost_simple(vlen(to - from));
+       float c = waypoint_getlinearcost(vlen(to - from));
 
        float height = from.z - to.z;
        if(height > jumpheight_vec.z && autocvar_sv_gravity > 0)
        {
                float height_cost = sqrt(height / (autocvar_sv_gravity / 2));
-               c = waypoint_getdistancecost_simple(vlen(vec2(to - from))); // xy distance cost
+               c = waypoint_getlinearcost(vlen(vec2(to - from))); // xy distance cost
                if(height_cost > c)
                        c = height_cost;
        }
@@ -477,7 +477,7 @@ float waypoint_getlinkcost(entity from, entity to)
                v2_y = bound(m1_y, v2_y, m2_y);
                v2_z = bound(m1_z, v2_z, m2_z);
        }
-       return waypoint_getdistancecost(v1, v2);
+       return waypoint_gettravelcost(v1, v2);
 }
 
 // add a new link to the spawnfunc_waypoint, replacing the furthest link it already has
index 1d3554f858b288478f7fffc4c5e1fe815c84047f..f772d046c7f1afb1f7dafa5646139cd773357e0d 100644 (file)
@@ -39,8 +39,8 @@ void waypoint_clearlinks(entity wp);
 void waypoint_schedulerelink(entity wp);
 
 float waypoint_getlinkcost(entity from, entity to);
-float waypoint_getdistancecost(vector v1, vector v2);
-float waypoint_getdistancecost_simple(float dist);
+float waypoint_gettravelcost(vector v1, vector v2);
+float waypoint_getlinearcost(float dist);
 void waypoint_updatecost_foralllinks();
 
 void waypoint_remove_fromeditor(entity pl);