git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1359 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
(no author)
2007-07-28 04:02:33 +00:00
parent 812bdeba3f
commit 5d6fbbdfc9

View File

@@ -12,25 +12,18 @@ namespace OpenRa.Game
static Rules()
{
IniFile rulesIni = new IniFile( FileSystem.Open( "rules.ini" ) );
using( Stream s = FileSystem.Open( "units.txt" ) )
{
StreamReader reader = new StreamReader( s );
IniFile rulesIni = new IniFile(FileSystem.Open("rules.ini"));
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();
if( unit == null )
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 ) );
Log.Write("rules.ini doesnt contain entry for unit \"{0}\"", unit);
continue;
}
unitInfos.Add(unit, new UnitInfo(section));
}
}