From f5e1510f58cc12b39f73e00d4e49992cb7b25cb5 Mon Sep 17 00:00:00 2001 From: Patrikkk Date: Fri, 12 Jun 2020 00:56:51 +0200 Subject: [PATCH] Bouncer OnTileEdit - Add new personalstorage tiles for ssc check. We do not allow piggybank and safe to be placed if SSC is enabled. The DefendersFroge and VoidVault have the same functionality as far as I know. So adding these two missing tiles. --- CHANGELOG.md | 1 + TShockAPI/Bouncer.cs | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e699b5b7..8bf59f56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Adding staff projectiles to the directionalProjectiles Dictionary to include staffs in the valid projectile creation check. * Adding GolfBallItemIDs list in Handlers.LandGolfBallInCupHandler.cs * Fixed an issue in the SendTileSquare handler that was rejecting valid tile objects (@QuiCM) +* Prevent player placing the Void Vault and Defenders Forge if the server is in SSC mode.(@Patrikkk) ## TShock 4.4.0 (Pre-release 11) * New permission `tshock.tp.pylon` to enable teleporting via Teleportation Pylons (@QuiCM) diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs index 3d6e7521..0cad0108 100644 --- a/TShockAPI/Bouncer.cs +++ b/TShockAPI/Bouncer.cs @@ -365,7 +365,7 @@ namespace TShockAPI args.Handled = true; return; } - if (action == EditAction.PlaceTile && (editData == TileID.PiggyBank || editData == TileID.Safes) && Main.ServerSideCharacter) + if (action == EditAction.PlaceTile && personalStorageTileIDs.Contains(editData) && Main.ServerSideCharacter) { TShock.Log.ConsoleDebug("Bouncer / OnTileEdit rejected from (sscprotect) {0} {1} {2}", args.Player.Name, action, editData); args.Player.SendErrorMessage("You cannot place this tile because server side characters are enabled."); @@ -2135,6 +2135,14 @@ namespace TShockAPI TileID.Campfire }; + private static List personalStorageTileIDs = new List() + { + TileID.PiggyBank, + TileID.Safes, + TileID.DefendersForge, + TileID.VoidVault + }; + /// /// These projectiles have been added or modified with Terraria 1.4. /// They come from normal items, but to have the directional functionality, they must be projectiles.