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);
{
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;
+ float 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) { }
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)));
#endif
#ifdef SVQC
{
if (playerdemo_read(this))
return;
- WITH(entity, self, this, bot_think());
+ bot_think(this);
}
#endif
else
PM_air(this, buttons_prev, maxspeed_mod);
-:end
+LABEL(end)
if (IS_ONGROUND(this))
this.lastground = time;
this.lastflags = this.flags;
this.lastclassname = this.classname;
-
-#ifdef CSQC
- this.v_angle = oldv_angle;
- this.angles = oldangles;
-#endif
}
#if defined(SVQC)