diff --git a/OpenRA.Editor/LegacyMapImporter.cs b/OpenRA.Editor/LegacyMapImporter.cs index d6df6b656b..e6201a1cf0 100644 --- a/OpenRA.Editor/LegacyMapImporter.cs +++ b/OpenRA.Editor/LegacyMapImporter.cs @@ -17,6 +17,7 @@ using OpenRA; using OpenRA.FileFormats; using OpenRA.Traits; using System.Drawing; +using System.Globalization; namespace OpenRA.Editor { @@ -401,7 +402,7 @@ namespace OpenRA.Editor { new LocationInit(new int2(loc % MapSize, loc / MapSize)), new OwnerInit(parts[0]), - new HealthInit(float.Parse(parts[2])/256), + new HealthInit(float.Parse(parts[2], NumberFormatInfo.InvariantInfo)/256), new FacingInit((section == "INFANTRY") ? int.Parse(parts[6]) : int.Parse(parts[4])), new ActorStanceInit(stance), }; diff --git a/OpenRA.FileFormats/FieldLoader.cs b/OpenRA.FileFormats/FieldLoader.cs index c26156296e..94d7f35537 100644 --- a/OpenRA.FileFormats/FieldLoader.cs +++ b/OpenRA.FileFormats/FieldLoader.cs @@ -13,6 +13,7 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Reflection; +using System.Globalization; namespace OpenRA.FileFormats { @@ -99,7 +100,7 @@ namespace OpenRA.FileFormats else if (fieldType == typeof(float)) { float res; - if (float.TryParse(x.Replace("%",""), out res)) + if (float.TryParse(x.Replace("%",""), System.Globalization.NumberStyles.Any, NumberFormatInfo.InvariantInfo, out res)) return res * (x.Contains( '%' ) ? 0.01f : 1f); return InvalidValueAction(x,fieldType, field); } diff --git a/OpenRA.Game/TraitCreator.cs b/OpenRA.Game/TraitCreator.cs deleted file mode 100755 index 673dd57678..0000000000 --- a/OpenRA.Game/TraitCreator.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using OpenRA.FileFormats; -using OpenRA.Traits; - -namespace OpenRA -{ - class TraitCreator - { - public static object Create( string traitName, World world, Actor actor, ITraitInfo info, TypeDictionary init ) - { - var argsDict = new Dictionary - { - { "world", world }, - { "self", actor }, - { "initDict", init }, - { "init", new ActorInitializer( actor, init ) }, - { "info", info }, - }; - return Game.modData.ObjectCreator.CreateObject( traitName, argsDict ); - } - } -}