diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index e7491632..1006b50f 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -4622,21 +4622,22 @@ namespace TShockAPI { if (args.Parameters.Count != 1) { - args.Player.SendErrorMessage(GetString("Invalid syntax. Proper syntax: {0}wind .", Specifier)); + args.Player.SendErrorMessage(GetString("Invalid syntax. Proper syntax: {0}wind .", Specifier)); return; } - int speed; - if (!int.TryParse(args.Parameters[0], out speed) || speed * 100 < 0) + float mph; + if (!float.TryParse(args.Parameters[0], out mph) || mph is < -40f or > 40f) { - args.Player.SendErrorMessage(GetString("Invalid wind speed.")); + args.Player.SendErrorMessage(GetString("Invalid wind speed (must be between -40 and 40).")); return; } + float speed = mph / 50f; // -40 to 40 mph -> -0.8 to 0.8 Main.windSpeedCurrent = speed; Main.windSpeedTarget = speed; TSPlayer.All.SendData(PacketTypes.WorldInfo); - TSPlayer.All.SendInfoMessage(GetString("{0} changed the wind speed to {1}.", args.Player.Name, speed)); + TSPlayer.All.SendInfoMessage(GetString("{0} changed the wind speed to {1}mph.", args.Player.Name, mph)); } #endregion Time/PvpFun Commands diff --git a/docs/changelog.md b/docs/changelog.md index 4866e01c..41fa2853 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -83,6 +83,7 @@ Use past tense when adding new entries; sign your name off when you add or chang * Changed the use of `Player.active` to `TSPlayer.Active` for consistency. (@sgkoishi, #2939) * Fix typo in config for IP bans. (@redchess64) * Fixed unable to transfer long response body for REST API. (@sgkoishi, #2925) +* Fixed the `/wind` command not being very helpful. (@punchready) ## TShock 5.2.1 * Updated `TSPlayer.GodMode`. (@AgaSpace)