{
if (!PHYS_FROZEN(this))
return;
- if (PHYS_DODGING_FROZEN(this)
-#ifdef SVQC
- && IS_REAL_CLIENT(this)
-#endif
- )
+ if (PHYS_DODGING_FROZEN(this) && IS_CLIENT(this))
{
// bind movement to a very slow speed so dodging can use .movement for directional calculations
PHYS_CS(this).movement_x = bound(-2, PHYS_CS(this).movement.x, 2);
else
PHYS_CS(this).movement = '0 0 0';
- vector midpoint = ((this.absmin + this.absmax) * 0.5);
- if (pointcontents(midpoint) == CONTENT_WATER)
+ if(this.waterlevel >= WATERLEVEL_SWIMMING)
{
this.velocity = this.velocity * 0.5;
-
- if (pointcontents(midpoint + '0 0 16') == CONTENT_WATER)
- this.velocity_z = 200;
+ if(this.waterlevel >= WATERLEVEL_SUBMERGED)
+ this.velocity.z = 160;
}
}
if (this.com_phys_water) {
// water jump only in certain situations
// this mimics quakeworld code
- if (this.com_in_jump && this.waterlevel == WATERLEVEL_SWIMMING && this.velocity_z >= -180 && !this.viewloc) {
+ if (this.com_in_jump && this.waterlevel == WATERLEVEL_SWIMMING && this.velocity_z >= -180 && !this.viewloc && !PHYS_FROZEN(this)) {
vector yawangles = '0 1 0' * this.v_angle.y;
vector forward, right, up;
MAKE_VECTORS(yawangles, forward, right, up);
vector wishvel = forward * PHYS_CS(this).movement.x
+ right * PHYS_CS(this).movement.y
+ '0 0 1' * PHYS_CS(this).movement.z * (this.com_phys_vel_2d ? 0 : 1);
- if (this.com_phys_water) {
+ if (this.com_phys_water && !PHYS_FROZEN(this)) {
if (PHYS_INPUT_BUTTON_CROUCH(this)) {
wishvel.z = -PHYS_MAXSPEED(this);
}
}
// holding jump button swims upward slowly
- if (this.com_in_jump && !this.viewloc) {
+ if (this.com_in_jump && !this.viewloc && !PHYS_FROZEN(this)) {
// was:
// lava: 50
// slime: 80