test unchanged miniyaml rules only once

This commit is contained in:
Matthias Mailänder
2015-08-04 14:04:48 +02:00
parent 6a1f7fd55a
commit fb22c9a1e5
14 changed files with 123 additions and 50 deletions

View File

@@ -20,7 +20,12 @@ namespace OpenRA.Mods.Common.Lint
{
public void Run(Action<string> emitError, Action<string> emitWarning, Map map)
{
foreach (var actorInfo in map.Rules.Actors)
if (map != null && !map.RuleDefinitions.Any())
return;
var rules = map == null ? Game.ModData.DefaultRules : map.Rules;
foreach (var actorInfo in rules.Actors)
{
var animations = actorInfo.Value.Traits.WithInterface<WithDeathAnimationInfo>().ToList();
if (!animations.Any())
@@ -34,7 +39,7 @@ namespace OpenRA.Mods.Common.Lint
if (!targetable.Any())
continue;
foreach (var weaponInfo in map.Rules.Weapons)
foreach (var weaponInfo in rules.Weapons)
{
var warheads = weaponInfo.Value.Warheads.OfType<DamageWarhead>().Where(dw => dw.Damage > 0);