From 4802ebed912615d720f05bb4cc7742948f909dd2 Mon Sep 17 00:00:00 2001 From: Chris <2648373+QuiCM@users.noreply.github.com> Date: Fri, 13 Nov 2020 19:04:53 +1030 Subject: [PATCH] Make gem locks work properly. Closes #2140 and #2036 --- CHANGELOG.md | 1 + TShockAPI/RegionHandler.cs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d44b31b..279ec0e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Added Torch God's Favor support in SSC. (@Stealownz) * SendTileSquare is now SendTileRect and can now send rectangles instead of squares. This is a breaking change (@QuiCM) * Destroying protected tiles underneath a tile object no longer causes the tile object to disappear for the client (@QuiCM) +* 'RegionProtectGemLocks' config option now works correctly. Gems can now be placed in Gem Locks while this option is enabled (@QuiCM) ## TShock 4.4.0 (Pre-release 13) * Terraria v1.4.1.1 diff --git a/TShockAPI/RegionHandler.cs b/TShockAPI/RegionHandler.cs index e8828c94..41b8efbb 100644 --- a/TShockAPI/RegionHandler.cs +++ b/TShockAPI/RegionHandler.cs @@ -57,7 +57,10 @@ namespace TShockAPI { if (TShock.Config.RegionProtectGemLocks) { - e.Handled = true; + if (!_regionManager.CanBuild(e.X, e.Y, e.Player)) + { + e.Handled = true; + } } }