From d478810336291c17c9d91bbadfe034e4a5c2f341 Mon Sep 17 00:00:00 2001 From: k0rd Date: Sun, 12 Feb 2012 15:27:23 -0500 Subject: [PATCH] -maxplayers or -players cl argument should override config additions to /removespecial --- TShockAPI/Commands.cs | 59 +++++++++++++++++++++++-------------------- TShockAPI/TShock.cs | 7 ++++- 2 files changed, 38 insertions(+), 28 deletions(-) mode change 100644 => 100755 TShockAPI/Commands.cs mode change 100644 => 100755 TShockAPI/TShock.cs diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs old mode 100644 new mode 100755 index dc875445..5697c1c1 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -1542,33 +1542,38 @@ namespace TShockAPI for (int x = 0; x < Main.maxTilesX; x++) { for (int y = 0; y < Main.maxTilesY; y++) - { - switch (Main.tile[x, y].type) - { - case 117: - case 25: - Main.tile[x, y].type = 1; - break; - case 109: - case 23: - Main.tile[x, y].type = 2; - break; - case 32: - Main.tile[x, y].type = 0; - Main.tile[x, y].active = false; - break; - case 24: - Main.tile[x, y].type = 3; - break; - case 112: - case 116: - Main.tile[x, y].type = 53; - break; - case 113: - Main.tile[x, y].type = 38; - break; - default: - continue; + { + switch (Main.tile[x, y].type) + { + case 117: + case 25: + Main.tile[x, y].type = 1; + break; + case 109: + case 23: + Main.tile[x, y].type = 2; + break; + case 32: + case 113: + case 110: + Main.tile[x, y].type = 0; + Main.tile[x, y].active = false; + break; + case 24: + Main.tile[x, y].type = 3; + break; + case 112: + case 116: + Main.tile[x, y].type = 53; + break; + case 118: + Main.tile[x, y].type = 38; + break; + case 115: + Main.tile[x, y].type = 52; + break; + default: + continue; } } } diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs old mode 100644 new mode 100755 index d9de18fb..76c91934 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -384,7 +384,12 @@ namespace TShockAPI Config.RestApiPort = Convert.ToInt32(parms[++i]); Console.WriteLine("Startup parameter overrode REST port."); - } + } + if ((parms[i].ToLower() == "-maxplayers")||(parms[i].ToLower() == "-players")) + { + Config.MaxSlots = Convert.ToInt32(parms[++i]); + Console.WriteLine("Startup parameter overrode maximum player slot configuration value."); + } } }