works *without* aftermath again.

This commit is contained in:
Chris Forbes
2009-11-26 20:49:54 +13:00
parent 9166029fc8
commit 1948e16a3f
5 changed files with 32 additions and 20 deletions

View File

@@ -63,6 +63,7 @@ namespace OpenRa.Game
controller = new Controller();
worldRenderer = new WorldRenderer( renderer );
SequenceProvider.Initialize(useAftermath);
viewport = new Viewport( clientSize, Rules.Map.Offset, Rules.Map.Offset + Rules.Map.Size, renderer );
world = new World();

View File

@@ -12,10 +12,17 @@ namespace OpenRa.Game.Graphics
static Dictionary<string, CursorSequence> cursors = new Dictionary<string, CursorSequence>();
static SequenceProvider()
public static void Initialize( bool useAftermath )
{
LoadSequenceSource("sequences.xml");
if (useAftermath)
LoadSequenceSource("sequences-aftermath.xml");
}
static void LoadSequenceSource(string filename)
{
XmlDocument document = new XmlDocument();
document.Load(FileSystem.Open("sequences.xml"));
document.Load(FileSystem.Open(filename));
foreach (XmlElement eUnit in document.SelectNodes("/sequences/unit"))
LoadSequencesForUnit(eUnit);

View File

@@ -45,8 +45,8 @@ namespace OpenRa.Game.Traits.Activities
umt = mobile.GetMovementType(),
checkForBlocked = false,
};
var refineries = Game.world.Actors.Where( x => x.unitInfo != null
&& x.unitInfo.Name == "proc" && x.Owner == self.Owner ).ToList();
var refineries = Game.world.Actors.Where( x => x.traits.Contains<AcceptsOre>()
&& x.Owner == self.Owner ).ToList();
if( refinery != null )
search.AddInitialCell( refinery.Location + refineryDeliverOffset );
else