more trivial cleanups
This commit is contained in:
@@ -96,14 +96,14 @@ namespace OpenRA.Mods.RA
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var producers = self.World.ActorsWithTrait<Production>()
|
var producers = self.World.ActorsWithTrait<Production>()
|
||||||
.Where( x => x.Actor.Owner == self.Owner )
|
.Where( x => x.Actor.Owner == self.Owner
|
||||||
.Where( x => x.Actor.Info.Traits.Get<ProductionInfo>().Produces.Contains( bi.Queue ) )
|
&& x.Actor.Info.Traits.Get<ProductionInfo>().Produces.Contains( bi.Queue ) )
|
||||||
.ToList();
|
.ToList();
|
||||||
var producer = producers.Where( x => x.Actor.IsPrimaryBuilding() ).Concat( producers )
|
var producer = producers.Where( x => x.Actor.IsPrimaryBuilding() ).Concat( producers )
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
|
||||||
if( producer.Actor != null )
|
if( producer.Actor != null )
|
||||||
producer.Actor.TraitsImplementing<RenderSimple>().First().PlayCustomAnim( producer.Actor, "build" );
|
producer.Actor.Trait<RenderSimple>().PlayCustomAnim( producer.Actor, "build" );
|
||||||
}
|
}
|
||||||
|
|
||||||
static int GetNumBuildables(Player p)
|
static int GetNumBuildables(Player p)
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ namespace OpenRA.Mods.RA
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var sp = self.TraitsImplementing<Production>().Where(p => p.Info.Produces.Contains(Info.Type)).FirstOrDefault();
|
var sp = self.TraitsImplementing<Production>().FirstOrDefault(p => p.Info.Produces.Contains(Info.Type));
|
||||||
if (sp != null && !IsDisabledBuilding(self) && sp.Produce(self, Rules.Info[ name ]))
|
if (sp != null && !IsDisabledBuilding(self) && sp.Produce(self, Rules.Info[ name ]))
|
||||||
{
|
{
|
||||||
FinishProduction();
|
FinishProduction();
|
||||||
|
|||||||
Reference in New Issue
Block a user