From: Mario Date: Sun, 24 Jul 2016 04:24:04 +0000 (+1000) Subject: Implement air dodging X-Git-Tag: xonotic-v0.8.2~700^2~45 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d15f83351909e54e4f7e6a0af117c7fa3fbe7eb4;p=xonotic%2Fxonotic-data.pk3dir.git Implement air dodging --- diff --git a/qcsrc/common/mutators/mutator/dodging/dodging.qc b/qcsrc/common/mutators/mutator/dodging/dodging.qc index 64312727e..6705664a5 100644 --- a/qcsrc/common/mutators/mutator/dodging/dodging.qc +++ b/qcsrc/common/mutators/mutator/dodging/dodging.qc @@ -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; diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 2ed679e30..ef1ba2fcf 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -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)