diff --git a/ClassicalSharp/Entities/LocalPlayer.cs b/ClassicalSharp/Entities/LocalPlayer.cs index 74b9e8eb0..ce2fdade6 100644 --- a/ClassicalSharp/Entities/LocalPlayer.cs +++ b/ClassicalSharp/Entities/LocalPlayer.cs @@ -29,6 +29,7 @@ namespace ClassicalSharp.Entities { internal SoundComponent sound; internal LocalInterpComponent interp; internal TiltComponent tilt; + bool hackPermMsgs; bool warnedRespawn, warnedFly, warnedNoclip; public LocalPlayer(Game game) : base(game) { @@ -146,6 +147,7 @@ namespace ClassicalSharp.Entities { Hacks.FullBlockStep = Options.GetBool(OptionsKey.FullBlockStep, false); physics.userJumpVel = Options.GetFloat(OptionsKey.JumpVelocity, 0.0f, 52.0f, 0.42f); physics.jumpVel = physics.userJumpVel; + hackPermMsgs = Options.GetBool(OptionsKey.HackPermMsgs, true); } void IGameComponent.Ready(Game game) { } @@ -209,7 +211,7 @@ namespace ClassicalSharp.Entities { return true; } else if (!warnedRespawn) { warnedRespawn = true; - if (!game.ClassicMode) game.Chat.Add("&cRespawning is currently disabled"); + if (!hackPermMsgs) game.Chat.Add("&cRespawning is currently disabled"); } return false; } @@ -231,7 +233,7 @@ namespace ClassicalSharp.Entities { return true; } else if (!warnedFly) { warnedFly = true; - if (!game.ClassicMode) game.Chat.Add("&cFlying is currently disabled"); + if (!hackPermMsgs) game.Chat.Add("&cFlying is currently disabled"); } return false; } @@ -245,7 +247,7 @@ namespace ClassicalSharp.Entities { return true; } else if (!warnedNoclip) { warnedNoclip = true; - if (!game.ClassicMode) game.Chat.Add("&cNoclip is currently disabled"); + if (!hackPermMsgs) game.Chat.Add("&cNoclip is currently disabled"); } return false; } diff --git a/ClassicalSharp/Utils/Options.cs b/ClassicalSharp/Utils/Options.cs index c65195ce3..32edf5d44 100644 --- a/ClassicalSharp/Utils/Options.cs +++ b/ClassicalSharp/Utils/Options.cs @@ -45,6 +45,7 @@ namespace ClassicalSharp { public const string CameraClipping = "hacks-cameraclipping"; public const string WOMStyleHacks = "hacks-womstylehacks"; public const string FullBlockStep = "hacks-fullblockstep"; + public const string HackPermMsgs = "hacks-perm-msgs"; public const string TabAutocomplete = "gui-tab-autocomplete"; public const string ShowBlockInHand = "gui-blockinhand"; diff --git a/src/Entity.c b/src/Entity.c index d8d1a1372..7af6ba6d7 100644 --- a/src/Entity.c +++ b/src/Entity.c @@ -766,6 +766,7 @@ static void Player_Init(struct Entity* e) { *------------------------------------------------------LocalPlayer--------------------------------------------------------* *#########################################################################################################################*/ struct LocalPlayer LocalPlayer_Instance; +static bool hackPermMsgs; float LocalPlayer_JumpHeight(void) { struct LocalPlayer* p = &LocalPlayer_Instance; return (float)PhysicsComp_GetMaxHeight(p->Physics.JumpVel); @@ -901,6 +902,7 @@ static void LocalPlayer_Init(void) { hacks->FullBlockStep = Options_GetBool(OPT_FULL_BLOCK_STEP, false); p->Physics.UserJumpVel = Options_GetFloat(OPT_JUMP_VELOCITY, 0.0f, 52.0f, 0.42f); p->Physics.JumpVel = p->Physics.UserJumpVel; + hackPermMsgs = Options_GetBool(OPT_HACK_PERM_MSGS, true); } static void LocalPlayer_Reset(void) { @@ -970,7 +972,7 @@ static bool LocalPlayer_HandleRespawn(void) { return true; } else if (!p->_WarnedRespawn) { p->_WarnedRespawn = true; - if (!Game_ClassicMode) Chat_AddRaw("&cRespawning is currently disabled"); + if (hackPermMsgs) Chat_AddRaw("&cRespawning is currently disabled"); } return false; } @@ -994,7 +996,7 @@ static bool LocalPlayer_HandleFly(void) { return true; } else if (!p->_WarnedFly) { p->_WarnedFly = true; - if (!Game_ClassicMode) Chat_AddRaw("&cFlying is currently disabled"); + if (hackPermMsgs) Chat_AddRaw("&cFlying is currently disabled"); } return false; } @@ -1009,7 +1011,7 @@ static bool LocalPlayer_HandleNoClip(void) { return true; } else if (!p->_WarnedNoclip) { p->_WarnedNoclip = true; - if (!Game_ClassicMode) Chat_AddRaw("&cNoclip is currently disabled"); + if (hackPermMsgs) Chat_AddRaw("&cNoclip is currently disabled"); } return false; } diff --git a/src/Launcher.c b/src/Launcher.c index 257390e95..30157f48f 100644 --- a/src/Launcher.c +++ b/src/Launcher.c @@ -606,7 +606,6 @@ static void Launcher_ApplyUpdate(void) { if (res) Launcher_ShowError(res, "making update script executable"); /* TODO: (open -a Terminal ", '"' + path + '"'); on OSX */ - /* TODO: chmod +x on non-windows */ res = Platform_StartProcess(&scriptName, &scriptArgs); if (res) { Launcher_ShowError(res, "starting update script"); return; } } diff --git a/src/Options.h b/src/Options.h index 1bcdb0692..6b823e39f 100644 --- a/src/Options.h +++ b/src/Options.h @@ -45,6 +45,7 @@ extern const char* FpsLimit_Names[FPS_LIMIT_COUNT]; #define OPT_CAMERA_CLIPPING "hacks-cameraclipping" #define OPT_WOM_STYLE_HACKS "hacks-womstylehacks" #define OPT_FULL_BLOCK_STEP "hacks-fullblockstep" +#define OPT_HACK_PERM_MSGS "hacks-perm-msgs" #define OPT_TAB_AUTOCOMPLETE "gui-tab-autocomplete" #define OPT_SHOW_BLOCK_IN_HAND "gui-blockinhand"