if (self.crouch)
setanim(self, self.anim_duckjump, FALSE, TRUE, TRUE);
- else
+ else if (self.animstate_startframe != self.anim_melee_x || (self.animstate_startframe == self.anim_melee_x && time - self.animstate_starttime >= 21/20)) // jump animation shouldn't override melee until we have animation blending (or until the anim finished, 21/20 = numframes/fps)
setanim(self, self.anim_jump, FALSE, TRUE, TRUE);
if(g_jump_grunt)
}
void CheckWaterJump()
{
- local vector start, end;
+ vector start, end;
// check for a jump-out-of-water
makevectors (self.angles);
return;
}
}
-};
+}
void CheckPlayerJump()
{
if(self.flags & FL_ONGROUND)
float speedaward_lastsent;
void SV_PlayerPhysics()
{
- local vector wishvel, wishdir, v;
- local float wishspeed, f, maxspd_mod, spd, maxairspd, airaccel, swampspd_mod, buttons;
+ vector wishvel, wishdir, v;
+ float wishspeed, f, maxspd_mod, spd, maxairspd, airaccel, swampspd_mod, buttons;
string temps;
float buttons_prev;
float not_allowed_to_move;
maxspd_mod *= autocvar_g_movement_highspeed;
// fix physics stats for g_movement_highspeed
+ // TODO maybe rather use maxairspeed? needs testing
self.stat_sv_airaccel_qw = AdjustAirAccelQW(autocvar_sv_airaccel_qw, maxspd_mod);
if(autocvar_sv_airstrafeaccel_qw)
self.stat_sv_airstrafeaccel_qw = AdjustAirAccelQW(autocvar_sv_airstrafeaccel_qw, maxspd_mod);
MUTATOR_CALLHOOK(PlayerPhysics);
+ if(self.player_blocked)
+ {
+ self.movement = '0 0 0';
+ self.disableclientprediction = 1;
+ }
+
maxspd_mod = 1;
swampspd_mod = 1;
swampspd_mod = self.swamp_slowdown; //cvar("g_balance_swamp_moverate");
}
+ // conveyors: first fix velocity
+ if(self.conveyor.state)
+ self.velocity -= self.conveyor.movedir;
+
if(self.classname != "player")
{
maxspd_mod = autocvar_sv_spectator_speed_multiplier;
self.velocity = self.velocity * f;
else
self.velocity = '0 0 0';
+ /*
+ Mathematical analysis time!
+
+ Our goal is to invert this mess.
+
+ For the two cases we get:
+ v = v0 * (1 - frametime * (autocvar_sv_stopspeed / v0) * autocvar_sv_friction)
+ = v0 - frametime * autocvar_sv_stopspeed * autocvar_sv_friction
+ v0 = v + frametime * autocvar_sv_stopspeed * autocvar_sv_friction
+ and
+ v = v0 * (1 - frametime * autocvar_sv_friction)
+ v0 = v / (1 - frametime * autocvar_sv_friction)
+
+ These cases would be chosen ONLY if:
+ v0 < autocvar_sv_stopspeed
+ v + frametime * autocvar_sv_stopspeed * autocvar_sv_friction < autocvar_sv_stopspeed
+ v < autocvar_sv_stopspeed * (1 - frametime * autocvar_sv_friction)
+ and, respectively:
+ v0 >= autocvar_sv_stopspeed
+ v / (1 - frametime * autocvar_sv_friction) >= autocvar_sv_stopspeed
+ v >= autocvar_sv_stopspeed * (1 - frametime * autocvar_sv_friction)
+ */
}
// acceleration
if(self.flags & FL_ONGROUND)
self.lastground = time;
+ // conveyors: then break velocity again
+ if(self.conveyor.state)
+ self.velocity += self.conveyor.movedir;
+
self.lastflags = self.flags;
self.lastclassname = self.classname;
-};
+}