Apply patch from https://github.com/Pryaxis/TShock/pull/3018
This applies https://github.com/Pryaxis/TShock/pull/3018 as a patch per @punchready because they deleted the head repository so that we can't merge it and none of the git objects have valid refs anymore on the command line and we can't merge it on the gui.
This commit is contained in:
parent
2952762032
commit
b984ff8b65
2 changed files with 7 additions and 5 deletions
|
|
@ -4622,21 +4622,22 @@ namespace TShockAPI
|
|||
{
|
||||
if (args.Parameters.Count != 1)
|
||||
{
|
||||
args.Player.SendErrorMessage(GetString("Invalid syntax. Proper syntax: {0}wind <speed>.", Specifier));
|
||||
args.Player.SendErrorMessage(GetString("Invalid syntax. Proper syntax: {0}wind <speed in mph>.", 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue