Prevent invalid walls from hiding stuff.

This commit is contained in:
Deathmax 2011-08-13 20:04:00 +08:00
parent 258b7d48fb
commit e24df84d9a
2 changed files with 7 additions and 1 deletions

View file

@ -95,7 +95,7 @@ namespace TShockAPI
public string MediumcoreBanReason = "Death results in a ban";
public string MediumcoreKickReason = "Death results in a kick";
public string ProjectileAbuseReason = "Projectile abuse";
public string TileAbuseReason = "Tile abuse ({0})";
public bool EnableDNSHostResolution;

View file

@ -335,6 +335,12 @@ namespace TShockAPI
return true;
}
}
if (type == 3)
if (tiletype >= Main.maxWallTypes)
{
Tools.HandleGriefer(args.Player, string.Format(TShock.Config.TileAbuseReason, "Wall type out of bounds"));
return true;
}
if (!args.Player.Group.HasPermission("editspawn") && !TShock.Regions.CanBuild(x, y, args.Player) && TShock.Regions.InArea(x, y))
{
if ((DateTime.UtcNow - args.Player.LastTileChangeNotify).TotalMilliseconds > 1000)