set sv_dodging_air_dodging 0
set sv_dodging_wall_dodging 0 "allow dodging off walls"
-set sv_dodging_delay 0.5 "determines how long a player has to wait to be able to dodge again after dodging"
+set sv_dodging_delay 0.6 "determines how long a player has to wait to be able to dodge again after dodging"
set sv_dodging_up_speed 200 "the jump velocity of the dodge"
set sv_dodging_horiz_speed_min 200 "the lower bound of current velocity for force scaling"
set sv_dodging_horiz_speed_max 1000 "the upper bound of current velocity for force scaling"
bool PM_dodging_checkpressedkeys(entity this)
{
- // first check if the last dodge is far enough back in time so we can dodge again
- if ((time - this.last_dodging_time) < PHYS_DODGING_DELAY)
- return false;
-
bool frozen_dodging = (PHYS_FROZEN(this) && PHYS_DODGING_FROZEN(this));
bool frozen_no_doubletap = (frozen_dodging && !PHYS_DODGING_FROZEN_DOUBLETAP);
#undef X
if (!dodge_detected) return false;
-
//LOG_INFOF("dodge keys detected %f, speed %f\n", time, vlen(this.velocity));
+ // this check has to be after checking keys:
+ // the first key press of the double tap is allowed to be before dodging delay,
+ // only the second has to be after, otherwise +dodge gives an advantage because typical repress time is 0.1 s
+ // or higher which means players using +dodge would be able to do it more often
+ if ((time - this.last_dodging_time) < PHYS_DODGING_DELAY)
+ return false;
+
makevectors(this.angles);
bool can_dodge = (is_close_to_ground(this, PHYS_DODGING_HEIGHT_THRESHOLD) && (PHYS_DODGING_MAXSPEED == 0 || vdist(this.velocity, <, PHYS_DODGING_MAXSPEED)));