From 05f21fcbe24faa37a4adcea9839a565b818030d4 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Tue, 16 May 2023 19:22:43 +0200 Subject: [PATCH] DefaultSpriteSequence: Merge if statements for readability --- OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs b/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs index e691ceda53..0edc80411b 100644 --- a/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs +++ b/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs @@ -334,14 +334,11 @@ namespace OpenRA.Mods.Common.Graphics protected virtual IEnumerable ParseCombineFilenames(ModData modData, string tileset, int[] frames, MiniYaml data) { var filename = LoadField(Filename, data, null, out var location); - if (frames == null) + if (frames == null && LoadField(Length.Key, null, data) != "*") { - if (LoadField(Length.Key, null, data) != "*") - { - var subStart = LoadField("Start", 0, data); - var subLength = LoadField("Length", 1, data); - frames = Exts.MakeArray(subLength, i => subStart + i); - } + var subStart = LoadField("Start", 0, data); + var subLength = LoadField("Length", 1, data); + frames = Exts.MakeArray(subLength, i => subStart + i); } yield return new ReservationInfo(filename, frames, frames, location);