]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
explain common_factor, commend out debug stmts, kill unnecessary check
authorMartin Taibr <taibr.martin@gmail.com>
Thu, 17 Aug 2017 16:27:05 +0000 (18:27 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Thu, 17 Aug 2017 16:27:05 +0000 (18:27 +0200)
qcsrc/common/mutators/mutator/dodging/sv_dodging.qc

index 2fb8603e46bd04bdea8d34d03a4c244b61590d75..aeddcdb705fcaf09a2f1b2b8e9faacdd1904d8f3 100644 (file)
@@ -184,6 +184,7 @@ bool PM_dodging_checkpressedkeys(entity this)
        bool can_air_dodge = (PHYS_DODGING_AIR && (PHYS_DODGING_AIR_MAXSPEED == 0 || vdist(this.velocity, <, PHYS_DODGING_AIR_MAXSPEED)));
        if (!can_dodge && !can_wall_dodge && !can_air_dodge) return false;
 
+       //LOG_INFOF("dodge delay %f\n", time - this.last_dodging_time); // TODO lowest i got with double press: 0.63
        this.last_dodging_time = time;
 
        this.dodging_action = 1;
@@ -229,14 +230,12 @@ void PM_dodging(entity this)
        // will be called ramp_time/frametime times = 2 times. so, we need to
        // add 0.5 * the total speed each frame until the dodge action is done..
        float common_factor = PHYS_DODGING_FRAMETIME / PHYS_DODGING_RAMP_TIME;
-       //common_factor /= 2; // FIXME this is WRONG but this function is called twice per frame!!!
-
-       // if ramp time is smaller than frametime we get problems ;D
-       common_factor = min(common_factor, 1); // TODO necessary with dodging_force_remaining?
+       // NOTE: depending on cl_netfps the client may (and probably will) send more input frames during each server frame
+       // but common_factor uses server frame rate so players with higher cl_netfps will ramp slightly faster
 
        float velocity_increase = min(common_factor * this.dodging_force_total, this.dodging_force_remaining);
        this.dodging_force_remaining -= velocity_increase;
-       LOG_INFOF("time %f velocity_increase: %f\n", time, velocity_increase);
+       //LOG_INFOF("time %f velocity_increase: %f\n", time, velocity_increase);
        this.velocity += this.dodging_direction.x * velocity_increase * v_forward
                       + this.dodging_direction.y * velocity_increase * v_right;