Incorporate @Patrikkk's changes over Axeel's

The TSAPI that Patrikkk has does not contain public fields for the
referenced GameMode types.
This commit is contained in:
Lucas Nicodemus 2020-05-17 11:58:21 -07:00
parent 96468871a0
commit 1078b579c4
No known key found for this signature in database
GPG key ID: A07BD9023D1664DB

View file

@ -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");
}