diff --git a/OpenRA.Lint/YamlChecker.cs b/OpenRA.Lint/YamlChecker.cs index bfebb0d566..4738987ec6 100644 --- a/OpenRA.Lint/YamlChecker.cs +++ b/OpenRA.Lint/YamlChecker.cs @@ -20,6 +20,7 @@ namespace OpenRA.Lint { static int errors = 0; + // mimic Windows compiler error format static void EmitError(string e) { Console.WriteLine("OpenRA.Lint(1,1): Error: {0}", e); @@ -68,16 +69,8 @@ namespace OpenRA.Lint foreach (var testMap in maps) { - if (testMap.RuleDefinitions.Count < 1) - { - if (verbose) - Console.WriteLine("No custom rules detected. Omitting Map: {0}".F(testMap.Title)); - - continue; - } - if (verbose) - Console.WriteLine("Map: {0}".F(testMap.Title)); + Console.WriteLine("Testing map: {0}".F(testMap.Title)); testMap.PreloadRules(); foreach (var customPassType in Game.modData.ObjectCreator @@ -88,14 +81,11 @@ namespace OpenRA.Lint var customPass = (ILintPass)Game.modData.ObjectCreator .CreateBasic(customPassType); - if (verbose) - Console.WriteLine("Pass: {0}".F(customPassType.ToString())); - customPass.Run(EmitError, EmitWarning, testMap); } catch (Exception e) { - EmitError("Failed with exception: {0}".F(e)); + EmitError("{0} failed with exception: {0}".F(customPassType, e)); } } } diff --git a/OpenRA.Mods.RA/Lint/CheckActors.cs b/OpenRA.Mods.RA/Lint/CheckActors.cs new file mode 100644 index 0000000000..c6c259f3d0 --- /dev/null +++ b/OpenRA.Mods.RA/Lint/CheckActors.cs @@ -0,0 +1,28 @@ +#region Copyright & License Information +/* + * Copyright 2007-2014 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using System; +using System.Linq; +using OpenRA.Traits; + +namespace OpenRA.Mods.RA +{ + public class CheckActors : ILintPass + { + public void Run(Action emitError, Action emitWarning, Map map) + { + var actorTypes = map.Actors.Value.Values.Select(a => a.Type); + foreach (var actor in actorTypes) + if (!map.Rules.Actors.Keys.Contains(actor.ToLowerInvariant())) + emitError("Actor {0} is not defined by any rule.".F(actor)); + } + } +} + diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index aeb4fdda34..88a75a8b9c 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -518,6 +518,7 @@ + diff --git a/mods/cnc/maps/necessary_illusions.oramap b/mods/cnc/maps/necessary_illusions.oramap index ca462a0e47..be5d71ceb9 100644 Binary files a/mods/cnc/maps/necessary_illusions.oramap and b/mods/cnc/maps/necessary_illusions.oramap differ diff --git a/mods/ra/maps/desert-shellmap/map.yaml b/mods/ra/maps/desert-shellmap/map.yaml index cb74e78344..0b052318c9 100644 --- a/mods/ra/maps/desert-shellmap/map.yaml +++ b/mods/ra/maps/desert-shellmap/map.yaml @@ -439,7 +439,7 @@ Actors: Actor167: powr Location: 54,74 Owner: Allies - Actor39: pbox.e1 + Actor39: pbox Location: 70,89 Owner: Allies AlliedTechnologyCenter: miss @@ -452,10 +452,10 @@ Actors: Actor150: apwr Location: 94,90 Owner: Allies - Actor35: pbox.e1 + Actor35: pbox Location: 68,85 Owner: Allies - Actor178: pbox.e1 + Actor178: pbox Location: 77,76 Owner: Allies Actor300: brik @@ -495,7 +495,7 @@ Actors: AlliedWarFactory1: weap Location: 75,81 Owner: Allies - Actor156: pbox.e1 + Actor156: pbox Location: 52,71 Owner: Allies Actor343: brik @@ -628,10 +628,10 @@ Actors: Location: 82,69 Owner: Allies Facing: 0 - Actor30: pbox.e1 + Actor30: pbox Location: 47,77 Owner: Allies - Actor29: pbox.e1 + Actor29: pbox Location: 42,75 Owner: Allies Actor217: sbag @@ -1001,7 +1001,7 @@ Actors: Actor212: brik Location: 61,80 Owner: Allies - Actor361: pbox.e1 + Actor361: pbox Location: 71,96 Owner: Allies Actor365: hpad @@ -1016,7 +1016,7 @@ Actors: Actor193: fix Location: 69,70 Owner: Allies - Actor42: pbox.e1 + Actor42: pbox Location: 67,70 Owner: Allies Actor262: fenc @@ -1217,7 +1217,7 @@ Actors: LstUnload: waypoint Location: 60,93 Owner: Neutral - Actor184: pbox.e1 + Actor184: pbox Location: 96,79 Owner: Allies Paradrop1: waypoint diff --git a/mods/ra/rules/structures.yaml b/mods/ra/rules/structures.yaml index 49f1c47e6c..f9d3db2917 100644 --- a/mods/ra/rules/structures.yaml +++ b/mods/ra/rules/structures.yaml @@ -459,43 +459,6 @@ PBOX: FallbackRange: 6c0 AutoTarget: -# Legacy definitions to keep compatibility with outdated maps -PBOX.E1: - Inherits: PBOX - -Buildable: - RenderBuilding: - Image: PBOX - -PBOX.E3: - Inherits: PBOX - -Buildable: - RenderBuilding: - Image: PBOX - -PBOX.E4: - Inherits: PBOX - -Buildable: - RenderBuilding: - Image: PBOX - -PBOX.E7: - Inherits: PBOX - -Buildable: - RenderBuilding: - Image: PBOX - -PBOX.SHOK: - Inherits: PBOX - -Buildable: - RenderBuilding: - Image: PBOX - -PBOX.SNIPER: - Inherits: PBOX - -Buildable: - RenderBuilding: - Image: PBOX - HBOX: Inherits: ^Building Tooltip: @@ -545,43 +508,6 @@ HBOX: PortYaws: 0, 176, 341, 512, 682, 853 PortCones: 86, 86, 86, 86, 86, 86 -# Legacy definitions to keep compatibility with outdated maps -HBOX.E1: - Inherits: HBOX - -Buildable: - RenderBuilding: - Image: HBOX - -HBOX.E3: - Inherits: HBOX - -Buildable: - RenderBuilding: - Image: HBOX - -HBOX.E4: - Inherits: HBOX - -Buildable: - RenderBuilding: - Image: HBOX - -HBOX.E7: - Inherits: HBOX - -Buildable: - RenderBuilding: - Image: HBOX - -HBOX.SHOK: - Inherits: HBOX - -Buildable: - RenderBuilding: - Image: HBOX - -HBOX.SNIPER: - Inherits: HBOX - -Buildable: - RenderBuilding: - Image: HBOX - GUN: Inherits: ^Building Buildable: