use GameModeID instead of other consts
This commit is contained in:
parent
1ed95c737e
commit
01cf85c9ad
1 changed files with 5 additions and 6 deletions
|
|
@ -36,6 +36,7 @@ using Microsoft.Xna.Framework;
|
||||||
using OTAPI.Tile;
|
using OTAPI.Tile;
|
||||||
using TShockAPI.Localization;
|
using TShockAPI.Localization;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using Terraria.DataStructures;
|
||||||
|
|
||||||
namespace TShockAPI
|
namespace TShockAPI
|
||||||
{
|
{
|
||||||
|
|
@ -2144,12 +2145,10 @@ namespace TShockAPI
|
||||||
|
|
||||||
private static void ToggleExpert(CommandArgs args)
|
private static void ToggleExpert(CommandArgs args)
|
||||||
{
|
{
|
||||||
const int NormalMode = 0;
|
if (Main.GameMode != GameModeID.Expert)
|
||||||
const int ExpertMode = 1;
|
Main.GameMode = GameModeID.Expert;
|
||||||
if (Main.GameMode != ExpertMode)
|
else if (Main.GameMode == GameModeID.Expert)
|
||||||
Main.GameMode = ExpertMode;
|
Main.GameMode = GameModeID.Normal;
|
||||||
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