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

@@ -13,16 +13,10 @@ 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 );
while( true )
foreach (string line in Util.ReadAllLines(FileSystem.Open("units.txt")))
{
string unit = reader.ReadLine();
if( unit == null )
break;
unit = unit.Substring( 0, unit.IndexOf( ',' ) );
string unit = line.Substring(0, line.IndexOf(','));
IniSection section = rulesIni.GetSection(unit.ToUpperInvariant());
if (section == null)
{
@@ -32,7 +26,6 @@ namespace OpenRa.Game
unitInfos.Add(unit, new UnitInfo(section));
}
}
}
public static UnitInfo UnitInfo( string name )
{