Merge pull request #376 from k0rd/bugfix-devel

-maxplayers and -players override ; added hallowed vines and plants to /removespecial
This commit is contained in:
Will 2012-02-13 10:44:10 -08:00
commit 862a06e820
2 changed files with 41 additions and 30 deletions

62
TShockAPI/Commands.cs Normal file → Executable file
View file

@ -1542,33 +1542,38 @@ namespace TShockAPI
for (int x = 0; x < Main.maxTilesX; x++) for (int x = 0; x < Main.maxTilesX; x++)
{ {
for (int y = 0; y < Main.maxTilesY; y++) for (int y = 0; y < Main.maxTilesY; y++)
{ {
switch (Main.tile[x, y].type) switch (Main.tile[x, y].type)
{ {
case 117: case 117:
case 25: case 25:
Main.tile[x, y].type = 1; Main.tile[x, y].type = 1;
break; break;
case 109: case 109:
case 23: case 23:
Main.tile[x, y].type = 2; Main.tile[x, y].type = 2;
break; break;
case 32: case 32:
Main.tile[x, y].type = 0; case 113:
Main.tile[x, y].active = false; case 110:
break; Main.tile[x, y].type = 0;
case 24: Main.tile[x, y].active = false;
Main.tile[x, y].type = 3; break;
break; case 24:
case 112: Main.tile[x, y].type = 3;
case 116: break;
Main.tile[x, y].type = 53; case 112:
break; case 116:
case 113: Main.tile[x, y].type = 53;
Main.tile[x, y].type = 38; break;
break; case 118:
default: Main.tile[x, y].type = 38;
continue; break;
case 115:
Main.tile[x, y].type = 52;
break;
default:
continue;
} }
} }
} }
@ -2204,7 +2209,8 @@ namespace TShockAPI
private static void Reload(CommandArgs args) private static void Reload(CommandArgs args)
{ {
FileTools.SetupConfig(); FileTools.SetupConfig();
TShock.HandleCommandLinePostConfigLoad(Environment.GetCommandLineArgs());
TShock.Groups.LoadPermisions(); TShock.Groups.LoadPermisions();
TShock.Regions.ReloadAllRegions(); TShock.Regions.ReloadAllRegions();
args.Player.SendMessage( args.Player.SendMessage(

9
TShockAPI/TShock.cs Normal file → Executable file
View file

@ -355,7 +355,7 @@ namespace TShockAPI
} }
} }
private void HandleCommandLinePostConfigLoad(string[] parms) public static void HandleCommandLinePostConfigLoad(string[] parms)
{ {
for (int i = 0; i < parms.Length; i++) for (int i = 0; i < parms.Length; i++)
{ {
@ -384,7 +384,12 @@ namespace TShockAPI
Config.RestApiPort = Convert.ToInt32(parms[++i]); Config.RestApiPort = Convert.ToInt32(parms[++i]);
Console.WriteLine("Startup parameter overrode REST port."); 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.");
}
} }
} }