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)
|
private static void ToggleExpert(CommandArgs args)
|
||||||
{
|
{
|
||||||
if (Main.GameMode != GameModeID.Expert)
|
const int NormalMode = 0;
|
||||||
Main.GameMode = GameModeID.Expert;
|
const int ExpertMode = 1;
|
||||||
else if (Main.GameMode == GameModeID.Expert)
|
if (Main.GameMode != ExpertMode)
|
||||||
Main.GameMode = GameModeID.Normal;
|
Main.GameMode = ExpertMode;
|
||||||
|
else if (Main.GameMode == ExpertMode)
|
||||||
|
Main.GameMode = NormalMode;
|
||||||
|
|
||||||
TSPlayer.All.SendData(PacketTypes.WorldInfo);
|
TSPlayer.All.SendData(PacketTypes.WorldInfo);
|
||||||
args.Player.SendSuccessMessage("Expert mode is now {0}.", Main.expertMode ? "on" : "off");
|
args.Player.SendSuccessMessage("Expert mode is now {0}.", Main.expertMode ? "on" : "off");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue