mjumpheight = autocvar_sv_jumpvelocity;
if (self.waterlevel >= WATERLEVEL_SWIMMING)
{
- if (self.watertype == CONTENT_WATER)
- self.velocity_z = 200;
- else if (self.watertype == CONTENT_SLIME)
- self.velocity_z = 80;
- else
- self.velocity_z = 50;
-
+ self.velocity_z = self.stat_sv_maxspeed * 0.7;
return;
}
self.flags &~= FL_ONGROUND;
self.flags &~= FL_JUMPRELEASED;
- if (self.crouch)
- setanim(self, self.anim_duckjump, FALSE, TRUE, TRUE);
- 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);
+ animdecide_setaction(self, ANIMACTION_JUMP, TRUE);
if(g_jump_grunt)
PlayerSound(playersound_jump, CH_PLAYER, VOICETYPE_PLAYERSOUND);
rigvel_z -= frametime * autocvar_sv_gravity; // 4x gravity plays better
rigvel_xy = vec2(rigvel);
- if(g_bugrigs_planar_movement_car_jumping && !g_touchexplode) // touchexplode is a better way to handle collisions
+ if(g_bugrigs_planar_movement_car_jumping)
mt = MOVE_NORMAL;
else
mt = MOVE_NOMONSTERS;
WarpZone_PlayerPhysics_FixVAngle();
maxspd_mod = 1;
- if(g_minstagib && (self.items & IT_INVINCIBLE))
- maxspd_mod *= autocvar_g_minstagib_speed_highspeed;
if(self.ballcarried)
if(g_nexball)
maxspd_mod *= autocvar_g_nexball_basketball_carrier_highspeed;
else if(g_keepaway)
maxspd_mod *= autocvar_g_keepaway_ballcarrier_highspeed;
- if(g_runematch)
- {
- if(self.runes & RUNE_SPEED)
- {
- if(self.runes & CURSE_SLOW)
- maxspd_mod *= autocvar_g_balance_rune_speed_combo_highspeed;
- else
- maxspd_mod *= autocvar_g_balance_rune_speed_highspeed;
- }
- else if(self.runes & CURSE_SLOW)
- {
- maxspd_mod *= autocvar_g_balance_curse_slow_highspeed;
- }
- }
maxspd_mod *= autocvar_g_movement_highspeed;
// fix physics stats for g_movement_highspeed
self.punchvector = '0 0 0';
}
- if (clienttype(self) == CLIENTTYPE_BOT)
+ if (IS_BOT_CLIENT(self))
{
if(playerdemo_read())
return;
self.items &~= IT_USING_JETPACK;
- if(self.classname == "player")
+ if(IS_PLAYER(self))
{
if(self.race_penalty)
if(time > self.race_penalty)
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: check if we still convey stuff
- float conveyor_broken = FALSE;
- if(self.groundentity.classname == "func_conveyor")
- if(self.groundentity.nextthink)
- {
- if(!WarpZoneLib_BoxTouchesBrush(self.absmin + '0 0 -1', self.absmax + '0 0 -1', self.groundentity, self))
- self.groundentity = world;
- }
- if(!self.groundentity)
- {
- tracebox(self.origin + '0 0 -1', self.mins, self.maxs, self.origin + '0 0 -1', MOVE_NORMAL, self);
- if(trace_ent.classname == "func_conveyor")
- self.groundentity = trace_ent;
- }
-
// conveyors: first fix velocity
- if(self.groundentity.classname == "func_conveyor")
- if(self.groundentity.nextthink)
- self.velocity -= self.groundentity.movedir;
+ if(self.conveyor.state)
+ self.velocity -= self.conveyor.movedir;
- if(self.classname != "player")
+ if not(IS_PLAYER(self))
{
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);
}
if(self.flags & FL_ONGROUND)
- if(self.classname == "player") // no fall sounds for observers thank you very much
+ if(IS_PLAYER(self)) // no fall sounds for observers thank you very much
if(self.wasFlying)
{
self.wasFlying = 0;
if(IsFlying(self))
self.wasFlying = 1;
- if(self.classname == "player")
+ if(IS_PLAYER(self))
CheckPlayerJump();
if (self.flags & FL_WATERJUMP )
self.teleport_time = 0;
}
}
- else if (g_bugrigs && self.classname == "player")
+ else if (g_bugrigs && IS_PLAYER(self))
{
RaceCarPhysics();
}
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)
{
//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
{
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((g_cts || g_race) && self.classname != "observer") {
+ if((g_cts || g_race) && !IS_OBSERVER(self)) {
if(vlen(self.velocity - self.velocity_z * '0 0 1') > speedaward_speed) {
speedaward_speed = vlen(self.velocity - self.velocity_z * '0 0 1');
speedaward_holder = self.netname;
self.lastground = time;
// conveyors: then break velocity again
- if(self.groundentity.classname == "func_conveyor")
- if(self.groundentity.nextthink)
- self.velocity += self.groundentity.movedir;
+ if(self.conveyor.state)
+ self.velocity += self.conveyor.movedir;
self.lastflags = self.flags;
self.lastclassname = self.classname;