add a new lint check for map rule loading
This commit is contained in:
31
OpenRA.Mods.RA/Lint/CheckMapRules.cs
Normal file
31
OpenRA.Mods.RA/Lint/CheckMapRules.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#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 OpenRA.Traits;
|
||||||
|
|
||||||
|
namespace OpenRA.Mods.RA
|
||||||
|
{
|
||||||
|
public class CheckMapRules : ILintPass
|
||||||
|
{
|
||||||
|
public void Run(Action<string> emitError, Action<string> emitWarning, Map map)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Game.modData.RulesetCache.LoadMapRules(map);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
emitError(e.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -494,6 +494,7 @@
|
|||||||
<Compile Include="UtilityCommands\ActorStatsExport.cs" />
|
<Compile Include="UtilityCommands\ActorStatsExport.cs" />
|
||||||
<Compile Include="UtilityCommands\ExportCharacterSeparatedRules.cs" />
|
<Compile Include="UtilityCommands\ExportCharacterSeparatedRules.cs" />
|
||||||
<Compile Include="UtilityCommands\Extensions.cs" />
|
<Compile Include="UtilityCommands\Extensions.cs" />
|
||||||
|
<Compile Include="Lint\CheckMapRules.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\OpenRA.Game\OpenRA.Game.csproj">
|
<ProjectReference Include="..\OpenRA.Game\OpenRA.Game.csproj">
|
||||||
|
|||||||
Reference in New Issue
Block a user