Check for invalid place style

This commit is contained in:
Scavenger3 2013-07-06 22:18:26 +10:00
parent a01a33192a
commit 2bd9b6a6b6
2 changed files with 11 additions and 0 deletions

View file

@ -251,6 +251,8 @@ namespace TShockAPI
[Description("The path of the directory where logs should be written into.")] public string LogPath = "tshock";
[Description("Prevents players from placing tiles with an invalid style.")] public bool PreventInvalidPlaceStyle = true;
/// <summary>
/// Reads a configuration file from a given path
/// </summary>

View file

@ -1807,6 +1807,15 @@ namespace TShockAPI
args.Player.SendTileSquare(tileX, tileY);
return true;
}
if (type == 1 && TShock.Config.PreventInvalidPlaceStyle && ((tiletype == 4 && style > 8) ||
(tiletype == 13 && style > 4) || (tiletype == 15 && style > 1) || (tiletype == 21 && style > 6) ||
(tiletype == 82 && style > 5) || (tiletype == 91 && style > 3) || (tiletype == 105 && style > 42) ||
(tiletype == 135 && style > 3) || (tiletype == 139 && style > 12) || (tiletype == 144 && style > 2) ||
(tiletype == 149 && style > 2)))
{
args.Player.SendTileSquare(tileX, tileY);
return true;
}
}
if (TShock.CheckIgnores(args.Player))