PM_ClientMovement_Unstick(this);
// set crouched
- if (PHYS_INPUT_BUTTON_CROUCH(this))
+ bool do_crouch = PHYS_INPUT_BUTTON_CROUCH(this);
+ if(this.hook && !wasfreed(this.hook))
+ do_crouch = false;
+ if(hud != HUD_NORMAL)
+ do_crouch = false;
+ if(STAT(FROZEN, this))
+ do_crouch = false;
+ if((activeweapon == WEP_SHOCKWAVE || activeweapon == WEP_SHOTGUN) && viewmodel.animstate_startframe == viewmodel.anim_fire2_x && time < viewmodel.weapon_nextthink)
+ do_crouch = false;
+
+ if (do_crouch)
{
// wants to crouch, this always works
if (!IS_DUCKED(this)) SET_DUCKED(this);
bool doublejump = false;
float mjumpheight = PHYS_JUMPVELOCITY(this);
- if (MUTATOR_CALLHOOK(PlayerJump, this, doublejump, mjumpheight))
+ if (MUTATOR_CALLHOOK(PlayerJump, this, mjumpheight, doublejump))
return true;
- doublejump = player_multijump;
- mjumpheight = player_jumpheight;
+ mjumpheight = M_ARGV(1, float);
+ doublejump = M_ARGV(2, bool);
if (this.waterlevel >= WATERLEVEL_SWIMMING)
{
void CheckPlayerJump(entity this)
{
#ifdef SVQC
- float was_flying = ITEMS_STAT(this) & IT_USING_JETPACK;
+ bool was_flying = boolean(ITEMS_STAT(this) & IT_USING_JETPACK);
#endif
if (JETPACK_JUMP(this) < 2)
ITEMS_STAT(this) &= ~IT_USING_JETPACK;
if(PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_JETPACK(this))
{
- float air_jump = !PlayerJump(this) || player_multijump; // PlayerJump() has important side effects
- float activate = JETPACK_JUMP(this) && air_jump && PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_JETPACK(this);
- float has_fuel = !PHYS_JETPACK_FUEL(this) || PHYS_AMMO_FUEL(this) || ITEMS_STAT(this) & IT_UNLIMITED_WEAPON_AMMO;
+ bool playerjump = PlayerJump(this); // required
+
+ bool air_jump = !playerjump || M_ARGV(2, bool);
+ bool activate = JETPACK_JUMP(this) && air_jump && PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_JETPACK(this);
+ bool has_fuel = !PHYS_JETPACK_FUEL(this) || PHYS_AMMO_FUEL(this) || (ITEMS_STAT(this) & IT_UNLIMITED_WEAPON_AMMO);
if (!(ITEMS_STAT(this) & ITEM_Jetpack.m_itemid)) { }
else if (this.jetpack_stopped) { }
string specialcommand = "xwxwxsxsxaxdxaxdx1x ";
.float specialcommand_pos;
-void SpecialCommand()
+void SpecialCommand(entity this)
{
#ifdef SVQC
- if (!CheatImpulse(CHIMPULSE_GIVE_ALL.impulse))
+ if (!CheatImpulse(this, CHIMPULSE_GIVE_ALL.impulse))
LOG_INFO("A hollow voice says \"Plugh\".\n");
#endif
}
-float PM_check_specialcommand(entity this, float buttons)
+bool PM_check_specialcommand(entity this, int buttons)
{
#ifdef SVQC
string c;
if (this.specialcommand_pos >= strlen(specialcommand))
{
this.specialcommand_pos = 0;
- SpecialCommand();
+ SpecialCommand(this);
return true;
}
}
return true;
}
-#ifdef CSQC
-float autocvar_slowmo;
-#endif
-
void PM_Main(entity this)
{
int buttons = PHYS_INPUT_BUTTON_MASK(this);
this.spectatorspeed = STAT(SPECTATORSPEED);
- vector oldv_angle = this.v_angle;
- vector oldangles = this.angles; // we need to save these, as they're abused by other code
- this.v_angle = PHYS_INPUT_ANGLES(this);
- this.angles = PHYS_WORLD_ANGLES(this);
-
this.team = myteam + 1; // is this correct?
if (!(PHYS_INPUT_BUTTON_JUMP(this))) // !jump
UNSET_JUMP_HELD(this); // canjump = true
#ifdef SVQC
- WarpZone_PlayerPhysics_FixVAngle();
+ WarpZone_PlayerPhysics_FixVAngle(this);
#endif
float maxspeed_mod = 1;
maxspeed_mod *= PHYS_HIGHSPEED(this);
Physics_UpdateStats(this, maxspeed_mod);
if (this.PlayerPhysplug)
- if (this.PlayerPhysplug())
+ if (this.PlayerPhysplug(this))
return;
#elif defined(CSQC)
- if(autocvar_slowmo != STAT(MOVEVARS_TIMESCALE))
- cvar_set("slowmo", ftos(STAT(MOVEVARS_TIMESCALE)));
+ if(hud != HUD_NORMAL)
+ return; // no vehicle prediction (yet)
#endif
#ifdef SVQC
this.lastflags = this.flags;
this.lastclassname = this.classname;
-
-#ifdef CSQC
- this.v_angle = oldv_angle;
- this.angles = oldangles;
-#endif
}
#if defined(SVQC)
-void SV_PlayerPhysics()
+void SV_PlayerPhysics(entity this)
#elif defined(CSQC)
void CSQC_ClientMovement_PlayerMove_Frame(entity this)
#endif
{
-#ifdef SVQC
- SELFPARAM();
-#endif
PM_Main(this);
}