diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index 7c1a5214..e9a9ef3e 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -21,5 +21,6 @@ public int SpawnProtectionRadius = 5; public string DistributationAgent = "facepunch"; public int MaxSlots = 8; + public bool RangeChecks = true; } } \ No newline at end of file diff --git a/TShockAPI/ConfigurationManager.cs b/TShockAPI/ConfigurationManager.cs index 7e7c48cc..6e3fd578 100644 --- a/TShockAPI/ConfigurationManager.cs +++ b/TShockAPI/ConfigurationManager.cs @@ -26,6 +26,7 @@ namespace TShockAPI public static bool banBoom = true; public static bool kickBoom = true; public static bool spawnProtect = true; + public static bool rangeChecks = true; public static int spawnProtectRadius = 5; public static string distributationAgent = "facepunch"; public static int authToken; @@ -63,6 +64,7 @@ namespace TShockAPI spawnProtectRadius = cfg.SpawnProtectionRadius; distributationAgent = cfg.DistributationAgent; maxSlots = cfg.MaxSlots; + rangeChecks = cfg.RangeChecks; NPC.maxSpawns = defaultMaxSpawns; NPC.defaultSpawnRate = defaultSpawnRate; } @@ -97,6 +99,7 @@ namespace TShockAPI cfg.SpawnProtection = true; cfg.SpawnProtectionRadius = 5; cfg.MaxSlots = maxSlots; + cfg.RangeChecks = rangeChecks; string json = JsonConvert.SerializeObject(cfg, Formatting.Indented); TextWriter tr = new StreamWriter(FileTools.SaveDir + "config.json"); diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index c0aa6df8..85d6278b 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -19,7 +19,7 @@ namespace TShockAPI public static string saveDir = "./tshock/"; - public static Version VersionNum = new Version(2, 0, 0, 5); + public static Version VersionNum = new Version(2, 0, 0, 6); public static string VersionCodename = "UnrealIRCd ftw (irc.shankshock.com #terraria)"; @@ -280,7 +280,7 @@ namespace TShockAPI int plyY = Math.Abs((int)Main.player[e.Msg.whoAmI].position.Y / 16); int tileX = Math.Abs(x); int tileY = Math.Abs(y); - if (size > 5 || Math.Abs(plyX - tileX) > 32 || Math.Abs(plyY - tileY) > 32) + if (size > 5 || (ConfigurationManager.rangeChecks && (Math.Abs(plyX - tileX) > 32 || Math.Abs(plyY - tileY) > 32))) { Log.Debug(string.Format("SendTileSquare(PlyXY:{0}_{1}, TileXY:{2}_{3}, Result:{4}_{5}, Size:{6})", plyX, plyY, @@ -316,7 +316,7 @@ namespace TShockAPI return Tools.Kick(e.Msg.whoAmI, "Using dirt rod"); } - if ((Math.Abs(plyX - tileX) > 32) || (Math.Abs(plyY - tileY) > 32)) + if (ConfigurationManager.rangeChecks && ((Math.Abs(plyX - tileX) > 32) || (Math.Abs(plyY - tileY) > 32))) { Log.Debug(string.Format("TilePlaced(PlyXY:{0}_{1}, TileXY:{2}_{3}, Result:{4}_{5}, Type:{6})", plyX, plyY, @@ -503,7 +503,7 @@ namespace TShockAPI )); return Tools.HandleGriefer(e.Msg.whoAmI, "Manipulating liquid without bucket."); ; } - if ((Math.Abs(plyX - tileX) > 32) || (Math.Abs(plyY - tileY) > 32)) + if (ConfigurationManager.rangeChecks && ((Math.Abs(plyX - tileX) > 32) || (Math.Abs(plyY - tileY) > 32))) { Log.Debug(string.Format("Liquid(PlyXY:{0}_{1}, TileXY:{2}_{3}, Result:{4}_{5}, Amount:{6})", plyX, plyY,