Add new .NET 9 rules to editorconfig.

Don't enforce all the rules yet, since we are still targeting .NET 6.

Adjust cast to nullable in UnloadCargo.ChooseExitSubCell. Avoid this cast tripping up CA2021 on older NET SDK versions.
This commit is contained in:
RoosterDragon
2024-11-13 19:13:15 +00:00
committed by Pavel Penev
parent 7401182a1b
commit 9809f6ed08
2 changed files with 73 additions and 2 deletions

View File

@@ -55,8 +55,7 @@ namespace OpenRA.Mods.Common.Activities
return cargo.CurrentAdjacentCells()
.Shuffle(self.World.SharedRandom)
.Select(c => (c, pos.GetAvailableSubCell(c)))
.Cast<(CPos, SubCell SubCell)?>()
.Select(c => ((CPos Cell, SubCell SubCell)?)(c, pos.GetAvailableSubCell(c)))
.FirstOrDefault(s => s.Value.SubCell != SubCell.Invalid);
}