Merge pull request #3470 from ScottNZ/production

Favour newer buildings over older buildings when a unit can appear from ...
This commit is contained in:
Chris Forbes
2013-06-23 14:33:33 -07:00

View File

@@ -11,9 +11,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.Mods.RA.Buildings;
using OpenRA.Traits;
using OpenRA.FileFormats;
namespace OpenRA.Mods.RA
{
@@ -70,7 +70,8 @@ namespace OpenRA.Mods.RA
var producers = self.World.ActorsWithTrait<Production>()
.Where(x => x.Actor.Owner == self.Owner
&& x.Trait.Info.Produces.Contains(Info.Type))
.OrderByDescending(x => x.Actor.IsPrimaryBuilding() ? 1 : 0 ); // prioritize the primary.
.OrderByDescending(x => x.Actor.IsPrimaryBuilding())
.ThenByDescending(x => x.Actor.ActorID);
if (!producers.Any())
{