Fix IDE0074

This commit is contained in:
RoosterDragon
2023-04-05 19:20:51 +01:00
committed by Pavel Penev
parent cbd0583289
commit bd2b3d9793
30 changed files with 42 additions and 81 deletions

View File

@@ -29,9 +29,8 @@ namespace OpenRA.Mods.Common.Traits.Render
// Per-actor queue
var queue = ai.TraitInfos<ProductionQueueInfo>().FirstOrDefault(q => ProductionType == q.Type);
// No queues available - check for classic production queues
if (queue == null)
queue = rules.Actors[SystemActors.Player].TraitInfos<ProductionQueueInfo>().FirstOrDefault(q => ProductionType == q.Type);
// If no queues available - check for classic production queues
queue ??= rules.Actors[SystemActors.Player].TraitInfos<ProductionQueueInfo>().FirstOrDefault(q => ProductionType == q.Type);
if (queue == null)
throw new YamlException($"Can't find a queue with ProductionType '{ProductionType}'");
@@ -67,12 +66,9 @@ namespace OpenRA.Mods.Common.Traits.Render
queue = self.TraitsImplementing<ProductionQueue>()
.FirstOrDefault(q => Info.ProductionType == q.Info.Type);
if (queue == null)
{
// No queues available - check for classic production queues
queue = self.Owner.PlayerActor.TraitsImplementing<ProductionQueue>()
.FirstOrDefault(q => Info.ProductionType == q.Info.Type);
}
// If no queues available - check for classic production queues
queue ??= self.Owner.PlayerActor.TraitsImplementing<ProductionQueue>()
.FirstOrDefault(q => Info.ProductionType == q.Info.Type);
}
void ITick.Tick(Actor self)