From: terencehill Date: Thu, 14 Jun 2018 11:03:36 +0000 (+0200) Subject: Split havocbot_symmetryaxis_equation vector into separate floats X-Git-Tag: xonotic-v0.8.5~2058 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=87669c0716e955c0392d631770837a491b2bf459;p=xonotic%2Fxonotic-data.pk3dir.git Split havocbot_symmetryaxis_equation vector into separate floats --- diff --git a/qcsrc/common/gamemodes/gamemode/ctf/ctf.qc b/qcsrc/common/gamemodes/gamemode/ctf/ctf.qc index 9382c9d8d..c7ade8485 100644 --- a/qcsrc/common/gamemodes/gamemode/ctf/ctf.qc +++ b/qcsrc/common/gamemodes/gamemode/ctf/ctf.qc @@ -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; } diff --git a/qcsrc/server/bot/api.qh b/qcsrc/server/bot/api.qh index 51ac148fc..0ecd7b877 100644 --- a/qcsrc/server/bot/api.qh +++ b/qcsrc/server/bot/api.qh @@ -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; diff --git a/qcsrc/server/bot/default/waypoints.qc b/qcsrc/server/bot/default/waypoints.qc index b673ecf8c..dfa3ada52 100644 --- a/qcsrc/server/bot/default/waypoints.qc +++ b/qcsrc/server/bot/default/waypoints.qc @@ -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;