X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Fdodging%2Fdodging.qc;h=7ddfcea2ba770f027f55672766155697be635620;hb=a4bcbda7a1eb2367fae1c2514d474d426803a673;hp=6d3662c7372ec28e694deab0239616a588ebe70f;hpb=cd3d62397dfaa03707d6b273538e8ce0157fbde9;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mutators/mutator/dodging/dodging.qc b/qcsrc/common/mutators/mutator/dodging/dodging.qc index 6d3662c73..7ddfcea2b 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) if (check_close_to_ground(this, PHYS_DODGING_HEIGHT_THRESHOLD) != 1 && check_close_to_wall(this, PHYS_DODGING_DISTANCE_THRESHOLD) != 1) return true; @@ -189,7 +189,10 @@ void PM_dodging(entity this) } // make sure v_up, v_right and v_forward are sane - makevectors(this.angles); + if(PHYS_DODGING_AIR) + makevectors(this.v_angle); + else + makevectors(this.angles); // if we have e.g. 0.5 sec ramptime and a frametime of 0.25, then the ramp code // will be called ramp_time/frametime times = 2 times. so, we need to @@ -226,7 +229,7 @@ void PM_dodging(entity this) #ifdef SVQC if (autocvar_sv_dodging_sound) - PlayerSound(this, playersound_jump, CH_PLAYER, VOICETYPE_PLAYERSOUND); + PlayerSound(this, playersound_jump, CH_PLAYER, VOL_BASE, VOICETYPE_PLAYERSOUND); animdecide_setaction(this, ANIMACTION_JUMP, true); #endif @@ -267,24 +270,22 @@ void PM_dodging_GetPressedKeys(entity this) MUTATOR_HOOKFUNCTION(dodging, PlayerPhysics) { + entity player = M_ARGV(0, entity); + // print("dodging_PlayerPhysics\n"); - PM_dodging_GetPressedKeys(self); - PM_dodging(self); - return false; + PM_dodging_GetPressedKeys(player); + PM_dodging(player); } #ifdef SVQC -MUTATOR_HOOKFUNCTION(dodging, GetCvars) -{ - GetCvars_handleFloat(get_cvars_s, get_cvars_f, cvar_cl_dodging_timeout, "cl_dodging_timeout"); - return false; -} +REPLICATE(cvar_cl_dodging_timeout, float, "cl_dodging_timeout"); MUTATOR_HOOKFUNCTION(dodging, GetPressedKeys) { - PM_dodging_checkpressedkeys(self); - return false; + entity player = M_ARGV(0, entity); + + PM_dodging_checkpressedkeys(player); } #endif