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:
parent
96468871a0
commit
1078b579c4
1 changed files with 7 additions and 4 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue