diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cf40bf0..93f4893e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin ## TShock 4.5.12 * Fixed the ability to spawn Zenith projectile with non-original items. (@AgaSpace) +* Fixed item dupe via /logout & NPC. (@Terrarxxn) * Added hook `GetDataHandlers.OnNpcTalk` for NpcTalk and a handler for it that stops unregistered and logged out players from interacting with NPCs, preventing them from smuggling or duplicating items via NPC item slots. (@tru321) * Fixed the ability to create custom messages with your death (or the death of another player) (@AgaSpace) * Added the `OnSignRead` handler in `GetDataHandler`, and added the `SignRead` event. Added check to ensure the sign being read is within world bounds `(x >= 0 && y >= 0 && x < Main.maxTilesX && y < Main.maxTilesY)`. (@drunderscore) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index f498adf2..6b7f3259 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -911,6 +911,12 @@ namespace TShockAPI return; } + if (args.Player.TPlayer.talkNPC != -1) + { + args.Player.SendErrorMessage("Please close NPC windows before logging out."); + return; + } + args.Player.Logout(); args.Player.SendSuccessMessage("You have been successfully logged out of your account."); if (Main.ServerSideCharacter)