From 98a93693dad0315dddf471bc7e9aa52165d88e26 Mon Sep 17 00:00:00 2001 From: stacey <57187883+moisterrific@users.noreply.github.com> Date: Thu, 27 May 2021 13:00:33 -0400 Subject: [PATCH] Fix Torch God biome torch swap issue Can confirm this fixes the issue but not sure if it opens any new exploits --- TShockAPI/Bouncer.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs index ed4c031a..78872b1e 100644 --- a/TShockAPI/Bouncer.cs +++ b/TShockAPI/Bouncer.cs @@ -303,8 +303,20 @@ namespace TShockAPI args.Handled = true; return; } - - if (selectedItem.placeStyle != style) + + if (args.Player.TPlayer.unlockedBiomeTorches && args.Player.TPlayer.UsingBiomeTorches && + selectedItem.type == ItemID.Torch && editData == TileID.Torches) + { + if (style == TorchID.Demon || style == TorchID.Ice || + style == TorchID.Bone || style == TorchID.Desert || + style == TorchID.Corrupt || style == TorchID.Crimson || + style == TorchID.Hallowed || style == TorchID.Jungle) + { + args.Handled = false; + return; + } + } + else if (selectedItem.placeStyle != style) { TShock.Log.ConsoleError(string.Format("Bouncer / OnTileEdit rejected from (placestyle) {0} {1} {2} placeStyle: {3} expectedStyle: {4}", args.Player.Name, action, editData, style, selectedItem.placeStyle));