From 88ac9be55aeb4fc9b3fa2108a9a8a7fb5ece6595 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 7 Mar 2014 01:19:54 +0400 Subject: [PATCH 1/3] Add can-build check in /grow --- TShockAPI/Commands.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 19ccd9ed..2863be5f 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -4494,6 +4494,13 @@ namespace TShockAPI var name = "Fail"; var x = args.Player.TileX; var y = args.Player.TileY + 3; + + if (!TShock.Regions.CanBuild(x, y, args.Player)) + { + args.Player.SendErrorMessage("You're not allowed to build here!"); + return; + } + switch (args.Parameters[0].ToLower()) { case "tree": From d7a90e6b2c34e32539555ab7a12f9a94086c7f36 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 8 Mar 2014 04:03:27 +0400 Subject: [PATCH 2/3] Change the message --- TShockAPI/Commands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 2863be5f..81c3336a 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -4497,7 +4497,7 @@ namespace TShockAPI if (!TShock.Regions.CanBuild(x, y, args.Player)) { - args.Player.SendErrorMessage("You're not allowed to build here!"); + args.Player.SendErrorMessage("You have no permission to /grow in this area."); return; } From 65d3b973cb4dd1367a19418e66eb20b1458d2a19 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 8 Mar 2014 06:19:27 +0400 Subject: [PATCH 3/3] You're not allowed to change tiles here --- TShockAPI/Commands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 81c3336a..cc679441 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -4497,7 +4497,7 @@ namespace TShockAPI if (!TShock.Regions.CanBuild(x, y, args.Player)) { - args.Player.SendErrorMessage("You have no permission to /grow in this area."); + args.Player.SendErrorMessage("You're not allowed to change tiles here!"); return; }