float Physics_ClientOption(entity this, string option, float defaultval)
{
- if(IS_REAL_CLIENT(this) && Physics_Valid(this.cvar_cl_physics))
+ if(IS_REAL_CLIENT(this) && Physics_Valid(CS(this).cvar_cl_physics))
{
- string s = strcat("g_physics_", this.cvar_cl_physics, "_", option);
+ string s = strcat("g_physics_", CS(this).cvar_cl_physics, "_", option);
if(cvar_type(s) & CVAR_TYPEFLAG_EXISTS)
return cvar(s);
}
- if(autocvar_g_physics_clientselect && autocvar_g_physics_clientselect_default)
+ if(autocvar_g_physics_clientselect && autocvar_g_physics_clientselect_default && autocvar_g_physics_clientselect_default != "")
{
string s = strcat("g_physics_", autocvar_g_physics_clientselect_default, "_", option);
if(cvar_type(s) & CVAR_TYPEFLAG_EXISTS)
STAT(MOVEVARS_AIRACCELERATE, this) = Physics_ClientOption(this, "airaccelerate", autocvar_sv_airaccelerate);
STAT(MOVEVARS_AIRSTOPACCELERATE, this) = Physics_ClientOption(this, "airstopaccelerate", autocvar_sv_airstopaccelerate);
STAT(MOVEVARS_JUMPVELOCITY, this) = Physics_ClientOption(this, "jumpvelocity", autocvar_sv_jumpvelocity);
+ STAT(MOVEVARS_JUMPVELOCITY_CROUCH, this) = Physics_ClientOption(this, "jumpvelocity_crouch", autocvar_sv_jumpvelocity_crouch);
STAT(MOVEVARS_TRACK_CANJUMP, this) = Physics_ClientOption(this, "track_canjump", autocvar_sv_track_canjump);
}
#endif
#endif
bool doublejump = false;
- float mjumpheight = PHYS_JUMPVELOCITY(this);
+ float mjumpheight = ((PHYS_JUMPVELOCITY_CROUCH(this) && IS_DUCKED(this)) ? PHYS_JUMPVELOCITY_CROUCH(this) : PHYS_JUMPVELOCITY(this));
bool track_jump = PHYS_CL_TRACK_CANJUMP(this);
if (MUTATOR_CALLHOOK(PlayerJump, this, mjumpheight, doublejump))
#ifdef SVQC
- #define JETPACK_JUMP(s) s.cvar_cl_jetpack_jump
+ #define JETPACK_JUMP(s) CS(s).cvar_cl_jetpack_jump
#elif defined(CSQC)
float autocvar_cl_jetpack_jump;
#define JETPACK_JUMP(s) autocvar_cl_jetpack_jump
.float specialcommand_pos;
void SpecialCommand(entity this)
{
- if (!CheatImpulse(this, CHIMPULSE_GIVE_ALL.impulse))
- LOG_INFO("A hollow voice says \"Plugh\".\n");
+ if(autocvar_sv_cheats || this.maycheat)
+ {
+ if (!CheatImpulse(this, CHIMPULSE_GIVE_ALL.impulse))
+ LOG_INFO("A hollow voice says \"Plugh\".");
+ }
+ else
+ STAT(MOVEVARS_SPECIALCOMMAND, this) = true;
}
#endif
else
c = "?";
- if (c == substring(specialcommand, this.specialcommand_pos, 1))
+ if (c == substring(specialcommand, CS(this).specialcommand_pos, 1))
{
- this.specialcommand_pos += 1;
- if (this.specialcommand_pos >= strlen(specialcommand))
+ CS(this).specialcommand_pos += 1;
+ if (CS(this).specialcommand_pos >= strlen(specialcommand))
{
- this.specialcommand_pos = 0;
+ CS(this).specialcommand_pos = 0;
SpecialCommand(this);
return true;
}
}
- else if (this.specialcommand_pos && (c != substring(specialcommand, this.specialcommand_pos - 1, 1)))
- this.specialcommand_pos = 0;
+ else if (CS(this).specialcommand_pos && (c != substring(specialcommand, CS(this).specialcommand_pos - 1, 1)))
+ CS(this).specialcommand_pos = 0;
#endif
return false;
}
{
#ifdef SVQC
// needs to be called before physics are run!
- PM_UpdateButtons(this, CS(this));
+ if(IS_REAL_CLIENT(this))
+ PM_UpdateButtons(this, CS(this));
#endif
sys_phys_update(this, PHYS_INPUT_TIMELENGTH);