diff --git a/CHANGELOG.md b/CHANGELOG.md index 31bb1005..86dc96b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Added handling to the PlayerChat hook event. (@QuiCM - Thanks for the suggestion @Arthri) * Changed the spawnboss command to support silent command specifiers. (@QuiCM, suggested by @nojomyth-dev) * Updated /godmode to use Journey Mode's Godmode power instead of healing on damage. (requested by @tlworks, backported by @bartico6, implemented preemptive bugfix for creative powers mentioned by @Stealownz) +* Fixed /r attempting to send messages to players that have since disconnected. (@bartico6, reported by @Arthri) ## TShock 4.5.0.1 * Fixed conversion from old to new ban system for MySQL hosted ban databases. (@DeathCradle, @ATFGK) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 3bff1f2b..7d2a42d2 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -5366,12 +5366,16 @@ namespace TShockAPI { args.Player.SendErrorMessage("You are muted."); } - else if (args.Player.LastWhisper != null) + else if (args.Player.LastWhisper != null && args.Player.LastWhisper.Active) { var msg = string.Join(" ", args.Parameters); args.Player.LastWhisper.SendMessage(String.Format(" {1}", args.Player.Name, msg), Color.MediumPurple); args.Player.SendMessage(String.Format(" {1}", args.Player.LastWhisper.Name, msg), Color.MediumPurple); } + else if (args.Player.LastWhisper != null) + { + args.Player.SendErrorMessage("The player you're attempting to reply to is no longer online."); + } else { args.Player.SendErrorMessage("You haven't previously received any whispers. Please use {0}whisper to whisper to other people.", Specifier);