]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/impulse.qc
Merged Lyberta/GivePlayerAmmo into Lyberta/RandomStartWeapons.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / impulse.qc
index aa18dab2ba07aba5eb4b1f686a5b04057d9c4f8b..a8b272f4c8a6cff8517c3eb5d2ffdbbd0e31113e 100644 (file)
@@ -97,7 +97,7 @@ X(0)
                for(int wepslot = 0; wepslot < MAX_WEAPONSLOTS; ++wepslot) \
                { \
                        .entity weaponentity = weaponentities[wepslot]; \
-                       W_CycleWeapon(this, this.cvar_cl_weaponpriorities[slot], dir, weaponentity); \
+                       W_CycleWeapon(this, CS(this).cvar_cl_weaponpriorities[slot], dir, weaponentity); \
                        if(wepslot == 0 && autocvar_g_weaponswitch_debug != 1) \
                                break; \
                } \
@@ -352,9 +352,9 @@ void ImpulseCommands(entity this)
 {
        if (game_stopped) return;
 
-       int imp = this.impulse;
+       int imp = CS(this).impulse;
        if (!imp) return;
-       this.impulse = 0;
+       CS(this).impulse = 0;
 
        if (MinigameImpulse(this, imp)) return;
 
@@ -584,12 +584,12 @@ vector waypoint_getSymmetricalOrigin(vector org, int ctf_flags)
        }
        else if (fabs(autocvar_g_waypointeditor_symmetrical) == 2)
        {
-               float m = havocbot_symmetryaxys_equation.x;
-               float q = havocbot_symmetryaxys_equation.y;
+               float m = havocbot_symmetryaxis_equation.x;
+               float q = havocbot_symmetryaxis_equation.y;
                if (autocvar_g_waypointeditor_symmetrical == -2)
                {
-                       m = autocvar_g_waypointeditor_symmetrical_axys.x;
-                       q = autocvar_g_waypointeditor_symmetrical_axys.y;
+                       m = autocvar_g_waypointeditor_symmetrical_axis.x;
+                       q = autocvar_g_waypointeditor_symmetrical_axis.y;
                }
 
                new_org.x = (1 / (1 + m*m)) * ((1 - m*m) * org.x + 2 * m * org.y - 2 * m * q);
@@ -604,8 +604,9 @@ IMPULSE(navwaypoint_spawn)
        if (!autocvar_g_waypointeditor) return;
        entity e;
        vector org = this.origin;
-       bool sym = boolean(autocvar_g_waypointeditor_symmetrical);
-       int ctf_flags = havocbot_symmetryaxys_equation.z;
+       int ctf_flags = havocbot_symmetryaxis_equation.z;
+       bool sym = ((autocvar_g_waypointeditor_symmetrical > 0 && ctf_flags >= 2)
+                  || (autocvar_g_waypointeditor_symmetrical < 0));
        int order = ctf_flags;
        if(autocvar_g_waypointeditor_symmetrical_order >= 2)
        {
@@ -635,8 +636,9 @@ IMPULSE(navwaypoint_remove)
 {
        if (!autocvar_g_waypointeditor) return;
        entity e = navigation_findnearestwaypoint(this, false);
-       bool sym = boolean(autocvar_g_waypointeditor_symmetrical);
-       int ctf_flags = havocbot_symmetryaxys_equation.z;
+       int ctf_flags = havocbot_symmetryaxis_equation.z;
+       bool sym = ((autocvar_g_waypointeditor_symmetrical > 0 && ctf_flags >= 2)
+                  || (autocvar_g_waypointeditor_symmetrical < 0));
        int order = ctf_flags;
        if(autocvar_g_waypointeditor_symmetrical_order >= 2)
        {
@@ -658,7 +660,7 @@ IMPULSE(navwaypoint_remove)
        if (sym)
        {
                vector org = waypoint_getSymmetricalOrigin(e.origin, ctf_flags);
-               FOREACH_ENTITY_CLASS("waypoint", !(it.wpflags & WAYPOINTFLAG_GENERATED), {
+               IL_EACH(g_waypoints, !(it.wpflags & WAYPOINTFLAG_GENERATED), {
                        if(vdist(org - it.origin, <, 3))
                        {
                                wp_sym = it;