setsize(this, STAT(PL_MIN, this), STAT(PL_MAX, this));
}
}
-#ifdef CSQC
- if (IS_ONGROUND(this) || this.velocity.z <= 0 || PHYS_WATERJUMP_TIME(this) <= 0)
- PHYS_WATERJUMP_TIME(this) = 0;
-#endif
+ _Movetype_CheckWater(this); // needs to be run on the client, might as well use the latest on the server too!
}
void CPM_PM_Aircontrol(entity this, float dt, vector wishdir, float wishspeed)
this.velocity_z = 225;
this.flags |= FL_WATERJUMP;
SET_JUMP_HELD(this);
- #ifdef SVQC
- PHYS_TELEPORT_TIME(this) = time + 2; // safety net
- #elif defined(CSQC)
- PHYS_WATERJUMP_TIME(this) = 2;
- #endif
}
}
}
void sys_phys_fix(entity this, float dt)
{
this.team = myteam + 1; // is this correct?
- PHYS_WATERJUMP_TIME(this) -= dt;
this.movement = PHYS_INPUT_MOVEVALUES(this);
this.items = STAT(ITEMS, this);
if (!(PHYS_INPUT_BUTTON_JUMP(this))) // !jump
if (this.flags & FL_WATERJUMP) {
this.velocity_x = this.movedir.x;
this.velocity_y = this.movedir.y;
- if (this.waterlevel == WATERLEVEL_NONE
- || time > PHYS_TELEPORT_TIME(this)
- || PHYS_WATERJUMP_TIME(this) <= 0
- ) {
+ if (this.waterlevel == WATERLEVEL_NONE) {
this.flags &= ~FL_WATERJUMP;
- PHYS_TELEPORT_TIME(this) = 0;
- PHYS_WATERJUMP_TIME(this) = 0;
}
} else if (MUTATOR_CALLHOOK(PM_Physics, this, maxspeed_mod, dt)) {
// handled
float wishspeed = min(vlen(wishvel), this.com_phys_vel_max);
if (this.com_phys_air) {
- if ((IS_SVQC && time >= PHYS_TELEPORT_TIME(this))
- || (IS_CSQC && PHYS_WATERJUMP_TIME(this) <= 0)) {
+ if (!(this.flags & FL_WATERJUMP)) {
// apply air speed limit
float airaccelqw = PHYS_AIRACCEL_QW(this);
float wishspeed0 = wishspeed;
if (this.com_phys_water) {
wishspeed *= 0.7;
- // if (PHYS_WATERJUMP_TIME(this) <= 0) // TODO: use
+ // if (!(this.flags & FL_WATERJUMP)) // TODO: use
{
// water friction
float f = 1 - dt * PHYS_FRICTION(this);
return;
}
- if (IS_CSQC ? PHYS_WATERJUMP_TIME(this) <= 0 : time >= PHYS_TELEPORT_TIME(this)) {
+ if (!(this.flags & FL_WATERJUMP)) {
PM_Accelerate(this, dt, wishdir, wishspeed, wishspeed, this.com_phys_acc_rate, 1, 0, 0, 0);
}
}
{
if(!autocvar_cl_movement) { return; }
- _Movetype_CheckWater(this); // we apparently need to check water *before* physics so it can use this for water jump
+ //_Movetype_CheckWater(this); // we apparently need to check water *before* physics so it can use this for water jump
vector oldv_angle = this.v_angle;
vector oldangles = this.angles; // we need to save these, as they're abused by other code