From fcccfc07e83f014e54756e5a138eff54509f3c92 Mon Sep 17 00:00:00 2001 From: Arthri <41360489+Arthri@users.noreply.github.com> Date: Mon, 19 Jul 2021 13:38:40 +0800 Subject: [PATCH] Fix invalid torch place style exploit --- TShockAPI/Bouncer.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs index 42cc6cd1..faea739c 100644 --- a/TShockAPI/Bouncer.cs +++ b/TShockAPI/Bouncer.cs @@ -308,8 +308,10 @@ namespace TShockAPI return; } - if ((args.Player.TPlayer.BiomeTorchHoldStyle(style) != args.Player.TPlayer.BiomeTorchPlaceStyle(style)) - && (selectedItem.placeStyle != style)) + var torchPlaceStyle = args.Player.TPlayer.UsingBiomeTorches + ? args.Player.TPlayer.BiomeTorchPlaceStyle(0) // using non-0 returns that number + : selectedItem.placeStyle; + if (torchPlaceStyle != style) { TShock.Log.ConsoleError("Bouncer / OnTileEdit rejected from (placestyle) {0} {1} {2} placeStyle: {3} expectedStyle: {4}", args.Player.Name, action, editData, style, selectedItem.placeStyle);