*/
void PlayerJump (void)
{
- if(self.freezetag_frozen)
+ if(self.freezetag_frozen || self.frozen)
return; // no jumping in freezetag when frozen
float mjumpheight;
}
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;
self.disableclientprediction = 0;
if(time < self.ladder_time)
self.disableclientprediction = 1;
+
+ if(self.frozen)
+ {
+ self.movement = '0 0 0';
+ self.disableclientprediction = 1;
+ }
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;
if(!self.spectatorspeed)
self.spectatorspeed = maxspd_mod;
- if(self.impulse && self.impulse <= 19)
+ if(self.impulse && self.impulse <= 19 || self.impulse >= 200 && self.impulse <= 209 || self.impulse >= 220 && self.impulse <= 229)
{
if(self.lastclassname != "player")
{
- if(self.impulse == 10 || self.impulse == 15 || self.impulse == 18)
+ if(self.impulse == 10 || self.impulse == 15 || self.impulse == 18 || self.impulse >= 200 && self.impulse <= 209)
self.spectatorspeed = bound(1, self.spectatorspeed + 0.5, 5);
else if(self.impulse == 11)
self.spectatorspeed = maxspd_mod;
- else if(self.impulse == 12 || self.impulse == 16 || self.impulse == 19)
+ else if(self.impulse == 12 || self.impulse == 16 || self.impulse == 19 || self.impulse >= 220 && self.impulse <= 229)
self.spectatorspeed = bound(1, self.spectatorspeed - 0.5, 5);
else if(self.impulse >= 1 && self.impulse <= 9)
self.spectatorspeed = 1 + 0.5 * (self.impulse - 1);
PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0, 0);
}
}
- else if ((self.items & IT_JETPACK) && self.BUTTON_HOOK && (!autocvar_g_jetpack_fuel || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO))
+ else if ((self.items & IT_JETPACK) && self.BUTTON_HOOK && (!autocvar_g_jetpack_fuel || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO) && !self.freezetag_frozen && !self.frozen)
{
//makevectors(self.v_angle_y * '0 1 0');
makevectors(self.v_angle);
else if (self.flags & FL_ONGROUND)
{
// we get here if we ran out of ammo
- if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32))
+ if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32) && self.ammo_fuel < 0.01)
sprint(self, "You don't have any fuel for the ^2Jetpack\n");
// walking
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
{
float wishspeed0;
// we get here if we ran out of ammo
- if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32))
+ if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32) && self.ammo_fuel < 0.01)
sprint(self, "You don't have any fuel for the ^2Jetpack\n");
if(maxspd_mod < 1)
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;
-};
+}