From acb6a96245609c90546d5ecb5da7192562df23c2 Mon Sep 17 00:00:00 2001 From: shell627 <69633838+Terrarxxn@users.noreply.github.com> Date: Wed, 1 Dec 2021 00:18:02 +0600 Subject: [PATCH 1/2] Fix item dupe via /logout & NPC (#2495 issue) --- CHANGELOG.md | 1 + TShockAPI/Commands.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62a73f8c..43c4b274 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,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) ## TShock 4.5.11 * Add the new allowed buff TentacleSpike to NPC buff cheat detection bouncer. (@sgkoishi) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 71e10a9d..09d4b253 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 window for logging out."); + return; + } + args.Player.Logout(); args.Player.SendSuccessMessage("You have been successfully logged out of your account."); if (Main.ServerSideCharacter) From 4aa75fe0235117c7dffd71da7ced9a62dfce5598 Mon Sep 17 00:00:00 2001 From: Chris <2648373+QuiCM@users.noreply.github.com> Date: Tue, 22 Feb 2022 19:15:58 +1030 Subject: [PATCH 2/2] Add suggestion Co-authored-by: Lucas Nicodemus --- TShockAPI/Commands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 09d4b253..fd065025 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -913,7 +913,7 @@ namespace TShockAPI if (args.Player.TPlayer.talkNPC != -1) { - args.Player.SendErrorMessage("Please close NPC window for logging out."); + args.Player.SendErrorMessage("Please close NPC windows before logging out."); return; }