From 1078b579c4629ab342b5b77a0ad0250be13b2302 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sun, 17 May 2020 11:58:21 -0700 Subject: [PATCH] Incorporate @Patrikkk's changes over Axeel's The TSAPI that Patrikkk has does not contain public fields for the referenced GameMode types. --- TShockAPI/Commands.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 86965b49..d934d512 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -2145,10 +2145,13 @@ namespace TShockAPI private static void ToggleExpert(CommandArgs args) { - if (Main.GameMode != GameModeID.Expert) - Main.GameMode = GameModeID.Expert; - else if (Main.GameMode == GameModeID.Expert) - Main.GameMode = GameModeID.Normal; + const int NormalMode = 0; + const int ExpertMode = 1; + if (Main.GameMode != ExpertMode) + Main.GameMode = ExpertMode; + else if (Main.GameMode == ExpertMode) + Main.GameMode = NormalMode; + TSPlayer.All.SendData(PacketTypes.WorldInfo); args.Player.SendSuccessMessage("Expert mode is now {0}.", Main.expertMode ? "on" : "off"); }