]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Turn 2 vectors into ints
authorterencehill <piuntn@gmail.com>
Fri, 24 Aug 2018 12:33:55 +0000 (14:33 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 24 Aug 2018 12:33:55 +0000 (14:33 +0200)
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qh

index 536e7cd77ca63b19177095f2f1c4e9dd162fbd7b..efbbf94e72aceee1716ad7d50f9ad49edc6a66b7 100644 (file)
@@ -186,7 +186,7 @@ void ctf_CalculatePassVelocity(entity flag, vector to, vector from, float turnra
                {
                        //print("normal arc line failed, trying to find new pos...");
                        WarpZone_TraceLine(to, targpos, MOVE_NOMONSTERS, flag);
-                       targpos = (trace_endpos + FLAG_PASS_ARC_OFFSET);
+                       targpos = (trace_endpos + eZ * FLAG_PASS_ARC_OFFSET_Z);
                        WarpZone_TraceLine(flag.origin, targpos, MOVE_NOMONSTERS, flag);
                        if(trace_fraction < 1) { targpos = to; /* print(" ^1FAILURE^7, reverting to original direction.\n"); */ }
                        /*else { print(" ^3SUCCESS^7, using new arc line.\n"); } */
@@ -934,7 +934,7 @@ void ctf_FlagThink(entity this)
                                {
                                        this.velocity = this.velocity * 0.5;
 
-                                       if(pointcontents(midpoint + FLAG_FLOAT_OFFSET) == CONTENT_WATER)
+                                       if (pointcontents(midpoint + eZ * FLAG_FLOAT_OFFSET_Z) == CONTENT_WATER)
                                                { this.velocity_z = autocvar_g_ctf_flag_dropped_floatinwater; }
                                        else
                                                { set_movetype(this, MOVETYPE_FLY); }
index 61dcb82ae2b68049118719d4fc7cca553f81b96c..350ad8c4ff6e0eed2304964fc4bd1c9ec31e5d7c 100644 (file)
@@ -43,8 +43,8 @@ const vector FLAG_DROP_OFFSET = ('0 0 32');
 const vector FLAG_CARRY_OFFSET = ('-16 0 8');
 #define FLAG_SPAWN_OFFSET ('0 0 1' * (PL_MAX_CONST.z - 13))
 const vector FLAG_WAYPOINT_OFFSET = ('0 0 64');
-const vector FLAG_FLOAT_OFFSET = ('0 0 32');
-const vector FLAG_PASS_ARC_OFFSET = ('0 0 -10');
+const int FLAG_FLOAT_OFFSET_Z = 32;
+const int FLAG_PASS_ARC_OFFSET_Z = -10;
 
 const vector VEHICLE_FLAG_OFFSET = ('0 0 96');
 const float VEHICLE_FLAG_SCALE = 1.0;