diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index be24b8b8..cf0cf21a 100755 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -394,6 +394,9 @@ namespace TShockAPI [Description("The maximum allowable MP, before equipment buffs.")] public int MaxMP = 200; + [Description("Determines if the server should save the world if the last player exits.")] + public bool SaveWorldOnLastPlayerExit = true; + /// /// Reads a configuration file from a given path /// diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 436acbea..21cadf21 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -1026,7 +1026,8 @@ namespace TShockAPI // The last player will leave after this hook is executed. if (Utils.ActivePlayers() == 1) { - SaveManager.Instance.SaveWorld(); + if (Config.SaveWorldOnLastPlayerExit) + SaveManager.Instance.SaveWorld(); SetConsoleTitle(true); } }