From aefde30a8d5790479ccfb8bbae9af88bed658718 Mon Sep 17 00:00:00 2001 From: Shank Date: Fri, 3 Jun 2011 03:02:48 -0600 Subject: [PATCH] Fixed /off, it now saves the world. Added /off-nosave, it doesn't. Raised threshold to 20. Closes #8 Closes #6 Closes #5 --- TShockAPI/Commands.cs | 7 +++++++ TShockAPI/TShock.cs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index b005d54a..57217799 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -54,6 +54,7 @@ namespace TShockAPI TShock.admincommandList.Add("kill", new CommandDelegate(Kill)); TShock.admincommandList.Add("help", new CommandDelegate(Help)); TShock.admincommandList.Add("slap", new CommandDelegate(Slap)); + TShock.admincommandList.Add("off-nosave", new CommandDelegate(OffNoSave)); TShock.commandList.Add("help", new CommandDelegate(Help)); TShock.commandList.Add("kill", new CommandDelegate(Kill)); } @@ -96,6 +97,12 @@ namespace TShockAPI } public static void Off(CommandArgs args) + { + WorldGen.saveWorld(); + Netplay.disconnect = true; + } + + public static void OffNoSave(CommandArgs args) { Netplay.disconnect = true; } diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index f036887d..62248162 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -312,7 +312,7 @@ namespace TShockAPI for (uint i = 0; i < Main.maxPlayers; i++) { if (Main.player[i].active == false) { continue; } - if (players[i].tileThreshold >= 5) + if (players[i].tileThreshold >= 20) { if (Main.player[i] != null) {