Return an error message for invalid cash amounts.
This commit is contained in:
committed by
abcdefg30
parent
347148e02f
commit
5c3d4a7fe4
@@ -92,8 +92,15 @@ namespace OpenRA.Mods.Common.Commands
|
|||||||
{
|
{
|
||||||
var giveCashOrder = new Order(command, world.LocalPlayer.PlayerActor, false);
|
var giveCashOrder = new Order(command, world.LocalPlayer.PlayerActor, false);
|
||||||
|
|
||||||
if (int.TryParse(arg, out var cash))
|
if (string.IsNullOrEmpty(arg))
|
||||||
|
giveCashOrder.ExtraData = 0;
|
||||||
|
else if (int.TryParse(arg, out var cash))
|
||||||
giveCashOrder.ExtraData = (uint)cash;
|
giveCashOrder.ExtraData = (uint)cash;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TextNotificationsManager.Debug("Invalid amount of cash.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
world.IssueOrder(giveCashOrder);
|
world.IssueOrder(giveCashOrder);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user