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);
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
#endif
{
#ifdef SVQC
- SELFPARAM();
+ SELFPARAM(); // needed for engine functions
#endif
PM_Main(this);
}