diff --git a/CHANGELOG.md b/CHANGELOG.md index 99453656..b086efa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Removed the config options `TileRectangleSizeThreshold` and `KickOnTileRectangleSizeThresholdBroken` because they are made obsolete by the new system, which will only allow valid rectangle sizes (at a maximum of only 4 by 4 tiles in 1.4.3.6). (@punchready) * Bumped Newtonsoft Json to 13.0.1. (@dependabot) * Allow the Cool Whip to apply `CoolWhipNPCDebuff` for `240` ticks, fixing abnormal NPC buff add rejects in Bouncer. (@drunderscore) +* Prevent Server Broadcast to display prefix without a message. (@PackmanDude, @punchready) ## TShock 4.5.17 * Fixed duplicate characters (twins) after repeatedly logging in as the same character due to connection not being immediately closed during `NetHooks_NameCollision`. (@PotatoCider) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 170de6c0..632642fb 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -1954,12 +1954,15 @@ namespace TShockAPI private static void Broadcast(CommandArgs args) { - string message = string.Join(" ", args.Parameters); + if (args.Parameters.Count > 0) + { + string message = string.Join(" ", args.Parameters); - TShock.Utils.Broadcast( - "(Server Broadcast) " + message, - Convert.ToByte(TShock.Config.Settings.BroadcastRGB[0]), Convert.ToByte(TShock.Config.Settings.BroadcastRGB[1]), - Convert.ToByte(TShock.Config.Settings.BroadcastRGB[2])); + TShock.Utils.Broadcast( + "(Server Broadcast) " + message, + Convert.ToByte(TShock.Config.Settings.BroadcastRGB[0]), Convert.ToByte(TShock.Config.Settings.BroadcastRGB[1]), + Convert.ToByte(TShock.Config.Settings.BroadcastRGB[2])); + } } private static void Off(CommandArgs args)