diff --git a/ClassicalSharp/2D/Screens/Menu/HacksSettingsScreen.cs b/ClassicalSharp/2D/Screens/Menu/HacksSettingsScreen.cs index 63be4460f..f4662f0fc 100644 --- a/ClassicalSharp/2D/Screens/Menu/HacksSettingsScreen.cs +++ b/ClassicalSharp/2D/Screens/Menu/HacksSettingsScreen.cs @@ -67,6 +67,8 @@ namespace ClassicalSharp.Gui.Screens { static string GetJump(Game g) { return g.LocalPlayer.JumpHeight.ToString("F3"); } static void SetJump(Game g, string v) { g.LocalPlayer.physics.CalculateJumpVelocity(true, Utils.ParseDecimal(v)); + float jumpVel = g.LocalPlayer.physics.jumpVel; + Options.Set(OptionsKey.JumpVelocity, jumpVel.ToString()); } static string GetWOMHacks(Game g) { return GetBool(g.LocalPlayer.Hacks.WOMStyleHacks); } diff --git a/ClassicalSharp/Entities/Components/PhysicsComponent.cs b/ClassicalSharp/Entities/Components/PhysicsComponent.cs index 56aeb041f..6f92bbeae 100644 --- a/ClassicalSharp/Entities/Components/PhysicsComponent.cs +++ b/ClassicalSharp/Entities/Components/PhysicsComponent.cs @@ -261,13 +261,11 @@ namespace ClassicalSharp.Entities { jumpVel = 0; if (jumpHeight == 0) return; - if (jumpHeight >= 256) jumpVel = 10.0f; + if (jumpHeight >= 256) jumpVel = 10.0f; if (jumpHeight >= 512) jumpVel = 16.5f; if (jumpHeight >= 768) jumpVel = 22.5f; - while (GetMaxHeight(jumpVel) <= jumpHeight) { - jumpVel += 0.001f; - } + while (GetMaxHeight(jumpVel) <= jumpHeight) { jumpVel += 0.001f; } if (userVel) userJumpVel = jumpVel; } diff --git a/ClassicalSharp/Entities/LocalPlayer.cs b/ClassicalSharp/Entities/LocalPlayer.cs index 5261e1eba..0a6a956c1 100644 --- a/ClassicalSharp/Entities/LocalPlayer.cs +++ b/ClassicalSharp/Entities/LocalPlayer.cs @@ -135,13 +135,18 @@ namespace ClassicalSharp.Entities { } public void Init(Game game) { - Hacks.SpeedMultiplier = Options.GetFloat(OptionsKey.Speed, 0.1f, 50, 10); - Hacks.PushbackPlacing = !game.ClassicMode && Options.GetBool(OptionsKey.PushbackPlacing, false); - Hacks.NoclipSlide = Options.GetBool(OptionsKey.NoclipSlide, false); - Hacks.WOMStyleHacks = !game.ClassicMode && Options.GetBool(OptionsKey.WOMStyleHacks, false); Hacks.Enabled = !game.PureClassic && Options.GetBool(OptionsKey.HacksOn, true); - Hacks.FullBlockStep = !game.ClassicMode && Options.GetBool(OptionsKey.FullBlockStep, false); Health = 20; + if (game.ClassicMode) return; + + Hacks.SpeedMultiplier = Options.GetFloat(OptionsKey.Speed, 0.1f, 50, 10); + Hacks.PushbackPlacing = Options.GetBool(OptionsKey.PushbackPlacing, false); + Hacks.NoclipSlide = Options.GetBool(OptionsKey.NoclipSlide, false); + Hacks.WOMStyleHacks = Options.GetBool(OptionsKey.WOMStyleHacks, false); + Hacks.FullBlockStep = Options.GetBool(OptionsKey.FullBlockStep, false); + physics.userJumpVel = Options.GetFloat(OptionsKey.JumpVelocity, 0.0f, 52.0f, 0.42f); + physics.jumpVel = physics.userJumpVel; + } public void Ready(Game game) { } diff --git a/ClassicalSharp/Utils/Options.cs b/ClassicalSharp/Utils/Options.cs index bd4cef3e4..8fa6a5175 100644 --- a/ClassicalSharp/Utils/Options.cs +++ b/ClassicalSharp/Utils/Options.cs @@ -38,6 +38,7 @@ namespace ClassicalSharp { public const string HacksOn = "hacks-hacksenabled"; public const string FieldOfView = "hacks-fov"; public const string Speed = "hacks-speedmultiplier"; + public const string JumpVelocity = "hacks-jumpvelocity"; public const string ModifiableLiquids = "hacks-liquidsbreakable"; public const string PushbackPlacing = "hacks-pushbackplacing"; public const string NoclipSlide = "hacks-noclipslide"; diff --git a/src/Client/Options.h b/src/Client/Options.h index 8f283e281..9a336b130 100644 --- a/src/Client/Options.h +++ b/src/Client/Options.h @@ -41,6 +41,7 @@ typedef UInt8 FpsLimitMethod; #define OptionsKey_HacksEnabled "hacks-hacksenabled" #define OptionsKey_FieldOfView "hacks-fov" #define OptionsKey_Speed "hacks-speedmultiplier" +#define OptionsKey_JumpVelocity "hacks-jumpvelocity" #define OptionsKey_ModifiableLiquids "hacks-liquidsbreakable" #define OptionsKey_PushbackPlacing "hacks-pushbackplacing" #define OptionsKey_NoclipSlide "hacks-noclipslide"