Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Torch God biome torch swap issue #2353

Merged
merged 6 commits into from
May 29, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
* Fixed torchgod settings to include whether or not torchgod has been fought by the player before and respect `usingBiomeTorches` setting. (@Quinci135)
* Fixed /worldmode not synchronising data to players after updating the world state (@bartico6, @Arthri)
* Added `OnSendNetData` hook to TSAPI, which enables developers to intercept traffic being sent from the server to clients. (@Stealownz)
* Fixed Torch God's Favor biome torch placement being rejected by the server. (@moisterrific)

## TShock 4.5.3
* Added permissions for using Teleportation Potions, Magic Conch, and Demon Conch. (@drunderscore)
Expand Down
9 changes: 5 additions & 4 deletions TShockAPI/Bouncer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,12 @@ internal void OnTileEdit(object sender, GetDataHandlers.TileEditEventArgs args)
args.Handled = true;
return;
}

if (selectedItem.placeStyle != style)

if ((args.Player.TPlayer.BiomeTorchHoldStyle(style) != args.Player.TPlayer.BiomeTorchPlaceStyle(style))
&& (selectedItem.placeStyle != style))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
&& (selectedItem.placeStyle != style))
&& (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));
TShock.Log.ConsoleError("Bouncer / OnTileEdit rejected from (placestyle) {0} {1} {2} placeStyle: {3} expectedStyle: {4}",
args.Player.Name, action, editData, style, selectedItem.placeStyle);
moisterrific marked this conversation as resolved.
Show resolved Hide resolved
args.Player.SendTileSquare(tileX, tileY, 1);
args.Handled = true;
return;
Expand Down