From c5bea39bf86b69139b75e6cffb4355579037cd2c Mon Sep 17 00:00:00 2001 From: steelphase Date: Tue, 7 Oct 2014 02:07:40 -0400 Subject: [PATCH] Mods.Common R# Console Resharper corrections. --- OpenRA.Mods.Common/Console/DevCommands.cs | 5 +++-- OpenRA.Mods.Common/Console/HelpCommand.cs | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/OpenRA.Mods.Common/Console/DevCommands.cs b/OpenRA.Mods.Common/Console/DevCommands.cs index def62aaed3..5cd20bff1b 100644 --- a/OpenRA.Mods.Common/Console/DevCommands.cs +++ b/OpenRA.Mods.Common/Console/DevCommands.cs @@ -9,6 +9,7 @@ #endregion using System; +using System.Globalization; using OpenRA.Graphics; using OpenRA.Traits; @@ -56,12 +57,12 @@ namespace OpenRA.Mods.Common { case "givecash": var order = new Order("DevGiveCash", world.LocalPlayer.PlayerActor, false); - var cash = 0; + int cash; if (int.TryParse(arg, out cash)) order.ExtraData = (uint)cash; - Game.Debug("Giving {0} credits to player {1}.", (cash == 0 ? "cheat default" : cash.ToString()), world.LocalPlayer.PlayerName); + Game.Debug("Giving {0} credits to player {1}.", cash == 0 ? "cheat default" : cash.ToString(CultureInfo.InvariantCulture), world.LocalPlayer.PlayerName); world.IssueOrder(order); break; diff --git a/OpenRA.Mods.Common/Console/HelpCommand.cs b/OpenRA.Mods.Common/Console/HelpCommand.cs index 32384e5c08..4055d90acb 100644 --- a/OpenRA.Mods.Common/Console/HelpCommand.cs +++ b/OpenRA.Mods.Common/Console/HelpCommand.cs @@ -19,9 +19,10 @@ namespace OpenRA.Mods.Common public class HelpCommand : IChatCommand, IWorldLoaded { + readonly Dictionary helpDescriptions; + World world; ChatCommands console; - Dictionary helpDescriptions; public HelpCommand() { @@ -43,7 +44,7 @@ namespace OpenRA.Mods.Common foreach (var key in console.Commands.Keys) { - var description = ""; + string description; if (!helpDescriptions.TryGetValue(key, out description)) description = "no description available.";