diff --git a/OpenRA.Mods.Common/Lint/CheckActorReferences.cs b/OpenRA.Mods.Common/Lint/CheckActorReferences.cs index 34e8f39af4..b025b6ff1a 100644 --- a/OpenRA.Mods.Common/Lint/CheckActorReferences.cs +++ b/OpenRA.Mods.Common/Lint/CheckActorReferences.cs @@ -92,7 +92,7 @@ namespace OpenRA.Mods.Common.Lint if (value == null) continue; - if (!dict.ContainsKey(value.ToLower())) + if (!dict.ContainsKey(value.ToLowerInvariant())) emitError("{0}.{1}.{2}: Missing weapon `{3}`." .F(actorInfo.Name, traitInfo.GetType().Name, fieldInfo.Name, value)); } @@ -110,7 +110,7 @@ namespace OpenRA.Mods.Common.Lint if (value == null) continue; - if (!dict.ContainsKey(value.ToLower())) + if (!dict.ContainsKey(value.ToLowerInvariant())) emitError("{0}.{1}.{2}: Missing voice `{3}`." .F(actorInfo.Name, traitInfo.GetType().Name, fieldInfo.Name, value)); } diff --git a/OpenRA.Mods.Common/Traits/Buildings/FreeActorWithDelivery.cs b/OpenRA.Mods.Common/Traits/Buildings/FreeActorWithDelivery.cs index 20a5b39343..4e2b8d3abe 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/FreeActorWithDelivery.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/FreeActorWithDelivery.cs @@ -88,7 +88,7 @@ namespace OpenRA.Mods.Common.Traits var initialFacing = self.World.Map.FacingBetween(location, self.Location, 0); // If aircraft, spawn at cruise altitude - var aircraftInfo = self.World.Map.Rules.Actors[deliveringActorName.ToLower()].TraitInfoOrDefault(); + var aircraftInfo = self.World.Map.Rules.Actors[deliveringActorName.ToLowerInvariant()].TraitInfoOrDefault(); if (aircraftInfo != null) spawn += new WVec(0, 0, aircraftInfo.CruiseAltitude.Length); diff --git a/OpenRA.Mods.Common/UtilityCommands/ImportLegacyMapCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ImportLegacyMapCommand.cs index 7ee01c09e8..8eaacf3a69 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ImportLegacyMapCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ImportLegacyMapCommand.cs @@ -182,19 +182,19 @@ namespace OpenRA.Mods.Common.UtilityCommands switch (s.Key) { case "Intro": - videos.Add(new MiniYamlNode("BackgroundVideo", s.Value.ToLower() + ".vqa")); + videos.Add(new MiniYamlNode("BackgroundVideo", s.Value.ToLowerInvariant() + ".vqa")); break; case "Brief": - videos.Add(new MiniYamlNode("BriefingVideo", s.Value.ToLower() + ".vqa")); + videos.Add(new MiniYamlNode("BriefingVideo", s.Value.ToLowerInvariant() + ".vqa")); break; case "Action": - videos.Add(new MiniYamlNode("StartVideo", s.Value.ToLower() + ".vqa")); + videos.Add(new MiniYamlNode("StartVideo", s.Value.ToLowerInvariant() + ".vqa")); break; case "Win": - videos.Add(new MiniYamlNode("WinVideo", s.Value.ToLower() + ".vqa")); + videos.Add(new MiniYamlNode("WinVideo", s.Value.ToLowerInvariant() + ".vqa")); break; case "Lose": - videos.Add(new MiniYamlNode("LossVideo", s.Value.ToLower() + ".vqa")); + videos.Add(new MiniYamlNode("LossVideo", s.Value.ToLowerInvariant() + ".vqa")); break; } } diff --git a/OpenRA.Mods.D2k/UtilityCommands/D2kMapImporter.cs b/OpenRA.Mods.D2k/UtilityCommands/D2kMapImporter.cs index 3f98074fe0..c190fd4900 100644 --- a/OpenRA.Mods.D2k/UtilityCommands/D2kMapImporter.cs +++ b/OpenRA.Mods.D2k/UtilityCommands/D2kMapImporter.cs @@ -322,7 +322,7 @@ namespace OpenRA.Mods.D2k.UtilityCommands // Get all templates from the tileset YAML file that have at least one frame and an Image property corresponding to the requested tileset // Each frame is a tile from the Dune 2000 tileset files, with the Frame ID being the index of the tile in the original file tileSetsFromYaml = tileSet.Templates.Where(t => t.Value.Frames != null - && t.Value.Images[0].ToLower() == tilesetName.ToLower()).Select(ts => ts.Value).ToList(); + && t.Value.Images[0].ToLowerInvariant() == tilesetName.ToLowerInvariant()).Select(ts => ts.Value).ToList(); var players = new MapPlayers(map.Rules, playerCount); map.PlayerDefinitions = players.ToMiniYaml(); @@ -350,7 +350,7 @@ namespace OpenRA.Mods.D2k.UtilityCommands if (ActorDataByActorCode.ContainsKey(tileSpecialInfo)) { var kvp = ActorDataByActorCode[tileSpecialInfo]; - if (!rules.Actors.ContainsKey(kvp.First.ToLower())) + if (!rules.Actors.ContainsKey(kvp.First.ToLowerInvariant())) throw new InvalidOperationException("Actor with name {0} could not be found in the rules YAML file!".F(kvp.First)); var a = new ActorReference(kvp.First) @@ -380,7 +380,7 @@ namespace OpenRA.Mods.D2k.UtilityCommands TerrainTile GetTile(int tileIndex) { // Some tiles are duplicates of other tiles, just on a different tileset - if (tilesetName.ToLower() == "bloxbgbs.r8") + if (tilesetName.ToLowerInvariant() == "bloxbgbs.r8") { if (tileIndex == 355) return new TerrainTile(441, 0); @@ -389,7 +389,7 @@ namespace OpenRA.Mods.D2k.UtilityCommands return new TerrainTile(442, 0); } - if (tilesetName.ToLower() == "bloxtree.r8") + if (tilesetName.ToLowerInvariant() == "bloxtree.r8") { var indices = new[] { 683, 684, 685, 706, 703, 704, 705, 726, 723, 724, 725, 746, 743, 744, 745, 747 }; for (var i = 0; i < 16; i++) @@ -410,7 +410,7 @@ namespace OpenRA.Mods.D2k.UtilityCommands return new TerrainTile(215, 0); } - if (tilesetName.ToLower() == "bloxwast.r8") + if (tilesetName.ToLowerInvariant() == "bloxwast.r8") { if (tileIndex == 342) return new TerrainTile(250, 0);