]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Split havocbot_symmetryaxis_equation vector into separate floats
authorterencehill <piuntn@gmail.com>
Thu, 14 Jun 2018 11:03:36 +0000 (13:03 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 14 Jun 2018 11:03:36 +0000 (13:03 +0200)
qcsrc/common/gamemodes/gamemode/ctf/ctf.qc
qcsrc/server/bot/api.qh
qcsrc/server/bot/default/waypoints.qc

index 9382c9d8d75bc8636964673164310ae8a0b8d2e8..c7ade848550cbf1c3a05ca15787f4f7ab3ec75f2 100644 (file)
@@ -1377,7 +1377,8 @@ void havocbot_ctf_calculate_middlepoint()
        havocbot_middlepoint = s / n;
        havocbot_middlepoint_radius = vlen(fo - havocbot_middlepoint);
 
-       havocbot_symmetryaxis_equation = '0 0 0';
+       havocbot_symmetry_axis_m = 0;
+       havocbot_symmetry_axis_q = 0;
        if(n == 2)
        {
                // for symmetrical editing of waypoints
@@ -1385,11 +1386,10 @@ void havocbot_ctf_calculate_middlepoint()
                entity f2 = f1.ctf_worldflagnext;
                float m = -(f1.origin.y - f2.origin.y) / (f1.origin.x - f2.origin.x);
                float q = havocbot_middlepoint.y - m * havocbot_middlepoint.x;
-               havocbot_symmetryaxis_equation.x = m;
-               havocbot_symmetryaxis_equation.y = q;
+               havocbot_symmetry_axis_m = m;
+               havocbot_symmetry_axis_q = q;
        }
-       // store number of flags in this otherwise unused vector component
-       havocbot_symmetryaxis_equation.z = n;
+       havocbot_symmetry_origin_order = n;
 }
 
 
index 51ac148fc13c42c1185866cd87d6430165f61b8e..0ecd7b87725b41f7ca894570f7343836a845d3da 100644 (file)
@@ -79,7 +79,9 @@ bool havocbot_goalrating_item_pickable_check_players(entity this, vector org, en
 
 vector havocbot_middlepoint;
 float havocbot_middlepoint_radius;
-vector havocbot_symmetryaxis_equation;
+float havocbot_symmetry_axis_m;
+float havocbot_symmetry_axis_q;
+float havocbot_symmetry_origin_order;
 
 .float goalentity_lock_timeout;
 .float ignoregoaltime;
index b673ecf8c18588f8e8bd86ed21d08baa61edfcd7..dfa3ada52236b5399921ff43cc3182c92c0e9238 100644 (file)
@@ -141,8 +141,8 @@ vector waypoint_getSymmetricalOrigin(vector org, int ctf_flags)
        }
        else if (fabs(autocvar_g_waypointeditor_symmetrical) == 2)
        {
-               float m = havocbot_symmetryaxis_equation.x;
-               float q = havocbot_symmetryaxis_equation.y;
+               float m = havocbot_symmetry_axis_m;
+               float q = havocbot_symmetry_axis_q;
                if (autocvar_g_waypointeditor_symmetrical == -2)
                {
                        m = autocvar_g_waypointeditor_symmetrical_axis.x;
@@ -246,7 +246,7 @@ void waypoint_spawn_fromeditor(entity pl)
 {
        entity e;
        vector org = pl.origin;
-       int ctf_flags = havocbot_symmetryaxis_equation.z;
+       int ctf_flags = havocbot_symmetry_origin_order;
        bool sym = ((autocvar_g_waypointeditor_symmetrical > 0 && ctf_flags >= 2)
                   || (autocvar_g_waypointeditor_symmetrical < 0));
        int order = ctf_flags;
@@ -309,7 +309,7 @@ void waypoint_remove_fromeditor(entity pl)
 {
        entity e = navigation_findnearestwaypoint(pl, false);
 
-       int ctf_flags = havocbot_symmetryaxis_equation.z;
+       int ctf_flags = havocbot_symmetry_origin_order;
        bool sym = ((autocvar_g_waypointeditor_symmetrical > 0 && ctf_flags >= 2)
                   || (autocvar_g_waypointeditor_symmetrical < 0));
        int order = ctf_flags;