]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Implement air dodging
authorMario <mario@smbclan.net>
Sun, 24 Jul 2016 04:24:04 +0000 (14:24 +1000)
committerMario <mario@smbclan.net>
Sun, 24 Jul 2016 04:24:04 +0000 (14:24 +1000)
qcsrc/common/mutators/mutator/dodging/dodging.qc
qcsrc/common/stats.qh

index 64312727e4e0cc682743643eefbb8e9af4d06f4b..6705664a57e880cf7ccb086fadedf7b26365c764 100644 (file)
@@ -10,6 +10,7 @@
 #define PHYS_DODGING_RAMP_TIME                                 STAT(DODGING_RAMP_TIME, this)
 #define PHYS_DODGING_UP_SPEED                          STAT(DODGING_UP_SPEED, this)
 #define PHYS_DODGING_WALL                                      STAT(DODGING_WALL, this)
+#define PHYS_DODGING_AIR                                       STAT(DODGING_AIR, this)
 #define PHYS_DODGING_PRESSED_KEYS(s)           (s).pressedkeys
 
 #ifdef CSQC
@@ -18,8 +19,6 @@
 #elif defined(SVQC)
        #define PHYS_DODGING_FRAMETIME                          sys_frametime
        #define PHYS_DODGING_TIMEOUT(s)                         s.cvar_cl_dodging_timeout
-
-
 #endif
 
 #ifdef SVQC
@@ -124,6 +123,7 @@ float PM_dodging_checkpressedkeys(entity this)
 
        makevectors(this.angles);
 
+       if(!PHYS_DODGING_AIR(this))
        if (check_close_to_ground(this, PHYS_DODGING_HEIGHT_THRESHOLD) != 1
                && check_close_to_wall(this, PHYS_DODGING_DISTANCE_THRESHOLD) != 1)
                return true;
index 2ed679e30f4e975b1590bddfcb643d1282de91e0..ef1ba2fcf292287ef5fe77a2c536ba09ef90cac6 100644 (file)
@@ -205,6 +205,7 @@ float autocvar_sv_dodging_horiz_speed_frozen;
 float autocvar_sv_dodging_ramp_time;
 float autocvar_sv_dodging_up_speed;
 bool autocvar_sv_dodging_wall_dodging;
+bool autocvar_sv_dodging_air_dodging;
 #endif
 
 REGISTER_STAT(DODGING, int, g_dodging)
@@ -219,7 +220,8 @@ REGISTER_STAT(DODGING_RAMP_TIME, float, autocvar_sv_dodging_ramp_time)
 /** cvar loopback */
 REGISTER_STAT(DODGING_TIMEOUT, float)
 REGISTER_STAT(DODGING_UP_SPEED, float, autocvar_sv_dodging_up_speed)
-REGISTER_STAT(DODGING_WALL, int, autocvar_sv_dodging_wall_dodging)
+REGISTER_STAT(DODGING_WALL, bool, autocvar_sv_dodging_wall_dodging)
+REGISTER_STAT(DODGING_AIR, bool, autocvar_sv_dodging_air_dodging)
 
 REGISTER_STAT(JETPACK_ACCEL_SIDE, float, autocvar_g_jetpack_acceleration_side)
 REGISTER_STAT(JETPACK_ACCEL_UP, float, autocvar_g_jetpack_acceleration_up)