this.move_watertype = CONTENT_EMPTY;
int supercontents = Mod_Q1BSP_SuperContentsFromNativeContents(nativecontents);
- if(supercontents & (DPCONTENTS_LIQUIDSMASK))
+ if(supercontents & DPCONTENTS_LIQUIDSMASK)
{
this.move_watertype = nativecontents;
this.move_waterlevel = WATERLEVEL_WETFEET;
point.z = this.move_origin.z + (this.mins.z + this.maxs.z) * 0.5;
- if(Mod_Q1BSP_SuperContentsFromNativeContents(pointcontents(point)) & (DPCONTENTS_LIQUIDSMASK))
+ if(Mod_Q1BSP_SuperContentsFromNativeContents(pointcontents(point)) & DPCONTENTS_LIQUIDSMASK)
{
this.move_waterlevel = WATERLEVEL_SWIMMING;
point.z = this.move_origin.z + this.view_ofs.z;
- if(Mod_Q1BSP_SuperContentsFromNativeContents(pointcontents(point)) & (DPCONTENTS_LIQUIDSMASK))
+ if(Mod_Q1BSP_SuperContentsFromNativeContents(pointcontents(point)) & DPCONTENTS_LIQUIDSMASK)
this.move_waterlevel = WATERLEVEL_SUBMERGED;
}
}
}
}
- if (IS_ONGROUND(this) || this.velocity.z <= 0 || PHYS_TELEPORT_TIME(this) <= 0)
- PHYS_TELEPORT_TIME(this) = 0;
+ if (IS_ONGROUND(this) || this.velocity.z <= 0 || pmove_waterjumptime <= 0)
+ pmove_waterjumptime = 0;
#endif
}
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)
+ pmove_waterjumptime = time + 2;
+ #endif
}
}
}
// acceleration
vector wishdir = normalize(wishvel);
float wishspeed = min(vlen(wishvel), PHYS_MAXSPEED(this) * maxspd_mod);
+#ifdef SVQC
if(time >= PHYS_TELEPORT_TIME(this))
+#endif
PM_Accelerate(this, wishdir, wishspeed, wishspeed, PHYS_ACCELERATE(this) * maxspd_mod, 1, 0, 0, 0);
PM_ClientMovement_Move(this);
}
{
this.velocity = forward * 50;
this.velocity_z = 310;
- PHYS_TELEPORT_TIME(this) = 2;
+ #ifdef CSQC
+ pmove_waterjumptime = 2;
+ #endif
UNSET_ONGROUND(this);
SET_JUMP_HELD(this);
}
vector wishdir = normalize(wishvel);
float wishspeed = vlen(wishvel);
- if(PHYS_TELEPORT_TIME(this) < time)
+#ifdef SVQC
+ if(time >= PHYS_TELEPORT_TIME(this))
+#elif defined(CSQC)
+ if(pmove_waterjumptime <= 0)
+#endif
{
float maxairspd = PHYS_MAXAIRSPEED(this) * min(maxspd_mod, 1);
this.team = myteam + 1; // is this correct?
if (!(PHYS_INPUT_BUTTON_JUMP(this))) // !jump
UNSET_JUMP_HELD(this); // canjump = true
- PHYS_TELEPORT_TIME(this) -= PHYS_INPUT_TIMELENGTH;
+ pmove_waterjumptime -= PHYS_INPUT_TIMELENGTH;
PM_ClientMovement_UpdateStatus(this, true);
#endif
setorigin(this, this.move_origin);
}
+void CSQCPlayer_CheckWater(entity this)
+{
+ this.move_origin = this.origin;
+ this.move_waterlevel = this.waterlevel;
+ this.move_watertype = this.watertype;
+ _Movetype_CheckWater(this);
+ this.waterlevel = this.move_waterlevel;
+ this.watertype = this.move_watertype;
+}
+
void CSQCPlayer_Physics(entity this)
{
if(autocvar_cl_movement)
{
+ if(autocvar_cl_movement == 3)
+ CSQCPlayer_CheckWater(this); // we apparently need to check water *before* physics so it can use this for water jump
+
CSQC_ClientMovement_PlayerMove_Frame(this);
if(autocvar_cl_movement == 3)