Favour newer buildings over older buildings when a unit can appear from multiple buildings after being built
This commit is contained in:
@@ -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())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user