diff --git a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs index f41a7954ba..94cc133711 100644 --- a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -283,7 +283,8 @@ namespace OpenRA.Mods.Common.Traits IEnumerable landingCells = Enumerable.Empty(); bool requireForceMove; - int creationActivityDelay; + + readonly int creationActivityDelay; bool notify = true; diff --git a/OpenRA.Mods.Common/Traits/Armament.cs b/OpenRA.Mods.Common/Traits/Armament.cs index a4844b22e2..4a467e0c34 100644 --- a/OpenRA.Mods.Common/Traits/Armament.cs +++ b/OpenRA.Mods.Common/Traits/Armament.cs @@ -125,9 +125,9 @@ namespace OpenRA.Mods.Common.Traits int ticksSinceLastShot; int currentBarrel; - int barrelCount; + readonly int barrelCount; - List<(int Ticks, Action Func)> delayedActions = new List<(int, Action)>(); + readonly List<(int Ticks, Action Func)> delayedActions = new List<(int, Action)>(); public WDist Recoil; public int FireDelay { get; protected set; } diff --git a/OpenRA.Mods.Common/Traits/Buildings/Building.cs b/OpenRA.Mods.Common/Traits/Buildings/Building.cs index 5cf89569c8..158cf2b120 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/Building.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/Building.cs @@ -274,9 +274,9 @@ namespace OpenRA.Mods.Common.Traits readonly Actor self; readonly BuildingInfluence influence; - (CPos, SubCell)[] occupiedCells; - (CPos, SubCell)[] targetableCells; - CPos[] transitOnlyCells; + readonly (CPos, SubCell)[] occupiedCells; + readonly (CPos, SubCell)[] targetableCells; + readonly CPos[] transitOnlyCells; public CPos TopLeft => topLeft; public WPos CenterPosition { get; private set; } diff --git a/OpenRA.Mods.Common/Traits/Palettes/IndexedPalette.cs b/OpenRA.Mods.Common/Traits/Palettes/IndexedPalette.cs index 88100cc0f5..97977aaa66 100644 --- a/OpenRA.Mods.Common/Traits/Palettes/IndexedPalette.cs +++ b/OpenRA.Mods.Common/Traits/Palettes/IndexedPalette.cs @@ -70,8 +70,8 @@ namespace OpenRA.Mods.Common.Traits public class IndexedColorRemap : IPaletteRemap { - Dictionary replacements = new Dictionary(); - IPalette basePalette; + readonly Dictionary replacements = new Dictionary(); + readonly IPalette basePalette; public IndexedColorRemap(IPalette basePalette, int[] ramp, int[] remap) { diff --git a/OpenRA.Mods.Common/Traits/Player/ProvidesTechPrerequisite.cs b/OpenRA.Mods.Common/Traits/Player/ProvidesTechPrerequisite.cs index 2d51fa78e3..423b126cfb 100644 --- a/OpenRA.Mods.Common/Traits/Player/ProvidesTechPrerequisite.cs +++ b/OpenRA.Mods.Common/Traits/Player/ProvidesTechPrerequisite.cs @@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits public class ProvidesTechPrerequisite : ITechTreePrerequisite { readonly ProvidesTechPrerequisiteInfo info; - bool enabled; + readonly bool enabled; static readonly string[] NoPrerequisites = Array.Empty();