git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1359 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
@@ -12,25 +12,18 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
static Rules()
|
static Rules()
|
||||||
{
|
{
|
||||||
IniFile rulesIni = new IniFile( FileSystem.Open( "rules.ini" ) );
|
IniFile rulesIni = new IniFile(FileSystem.Open("rules.ini"));
|
||||||
using( Stream s = FileSystem.Open( "units.txt" ) )
|
|
||||||
{
|
|
||||||
StreamReader reader = new StreamReader( s );
|
|
||||||
|
|
||||||
while( true )
|
foreach (string line in Util.ReadAllLines(FileSystem.Open("units.txt")))
|
||||||
|
{
|
||||||
|
string unit = line.Substring(0, line.IndexOf(','));
|
||||||
|
IniSection section = rulesIni.GetSection(unit.ToUpperInvariant());
|
||||||
|
if (section == null)
|
||||||
{
|
{
|
||||||
string unit = reader.ReadLine();
|
Log.Write("rules.ini doesnt contain entry for unit \"{0}\"", unit);
|
||||||
if( unit == null )
|
continue;
|
||||||
break;
|
|
||||||
unit = unit.Substring( 0, unit.IndexOf( ',' ) );
|
|
||||||
IniSection section = rulesIni.GetSection( unit.ToUpperInvariant() );
|
|
||||||
if( section == null )
|
|
||||||
{
|
|
||||||
Log.Write( "rules.ini doesnt contain entry for unit \"{0}\"", unit );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
unitInfos.Add( unit, new UnitInfo( section ) );
|
|
||||||
}
|
}
|
||||||
|
unitInfos.Add(unit, new UnitInfo(section));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user