Eradicate ☠ Mono ☠

Co-Authored-By: Gustas <37534529+punkpun@users.noreply.github.com>
This commit is contained in:
michaeldgg2
2024-09-13 23:01:58 +02:00
committed by Pavel Penev
parent 5450572e0a
commit c7cc9a68fd
35 changed files with 89 additions and 634 deletions

View File

@@ -159,15 +159,8 @@ namespace OpenRA.Mods.Common.Orders
if (mi.Modifiers.HasModifier(Modifiers.Alt))
modifiers |= TargetModifiers.ForceMove;
// The Select(x => x) is required to work around an issue on mono 5.0
// where calling OrderBy* on SelectManySingleSelectorIterator can in some
// circumstances (which we were unable to identify) replace entries in the
// enumeration with duplicates of other entries.
// Other action that replace the SelectManySingleSelectorIterator with a
// different enumerator type (e.g. .Where(true) or .ToList()) also work.
var orders = self.TraitsImplementing<IIssueOrder>()
.SelectMany(trait => trait.Orders.Select(x => new { Trait = trait, Order = x }))
.Select(x => x)
.OrderByDescending(x => x.Order.OrderPriority)
.ToList();