diff --git a/OpenRA.Game/GameRules/Rules.cs b/OpenRA.Game/GameRules/Rules.cs index 738478f0a2..12dca3a90c 100755 --- a/OpenRA.Game/GameRules/Rules.cs +++ b/OpenRA.Game/GameRules/Rules.cs @@ -30,7 +30,7 @@ namespace OpenRA // Added support to extend the list of rules (add it to m.LocalRules) Info = LoadYamlRules(m.Rules, map.Rules, (k, y) => new ActorInfo(k.Key.ToLowerInvariant(), k.Value, y)); Weapons = LoadYamlRules(m.Weapons, map.Weapons, (k, _) => new WeaponInfo(k.Key.ToLowerInvariant(), k.Value)); - Voices = LoadYamlRules(m.Voices, new List(), (k, _) => new VoiceInfo(k.Value)); + Voices = LoadYamlRules(m.Voices, map.Voices, (k, _) => new VoiceInfo(k.Value)); Music = LoadYamlRules(m.Music, new List(), (k, _) => new MusicInfo(k.Key, k.Value)); Movies = LoadYamlRules(m.Movies, new List(), (k, v) => k.Value.Value); diff --git a/OpenRA.Game/Map.cs b/OpenRA.Game/Map.cs index a075d447e8..c910df4141 100644 --- a/OpenRA.Game/Map.cs +++ b/OpenRA.Game/Map.cs @@ -36,6 +36,10 @@ namespace OpenRA // Weapon overrides public List Weapons = new List(); + + // Voices overrides + public List Voices = new List(); + // Binary map data public byte TileFormat = 1; [FieldLoader.Load] public int2 MapSize; @@ -189,6 +193,9 @@ namespace OpenRA // Weapons Weapons = (yaml.NodesDict.ContainsKey("Weapons")) ? yaml.NodesDict["Weapons"].Nodes : new List(); + // Voices + Voices = (yaml.NodesDict.ContainsKey("Voices")) ? yaml.NodesDict["Voices"].Nodes : new List(); + CustomTerrain = new string[MapSize.X, MapSize.Y]; LoadBinaryData(); } @@ -222,6 +229,7 @@ namespace OpenRA root.Add(new MiniYamlNode("Rules", null, Rules)); root.Add(new MiniYamlNode("Sequences", null, Sequences)); root.Add(new MiniYamlNode("Weapons", null, Weapons)); + root.Add(new MiniYamlNode("Voices", null, Voices)); SaveBinaryData(Path.Combine(filepath, "map.bin")); root.WriteToFile(Path.Combine(filepath, "map.yaml"));