From f1e8f9c9d09f2d6fba6eec446daef5781a821b5c Mon Sep 17 00:00:00 2001 From: atlimit8 Date: Sat, 2 May 2020 13:39:03 -0500 Subject: [PATCH] Fixed PNG frame count calculation This fixes the order of operations and rounding issue, making it columns * rows. --- OpenRA.Mods.Common/SpriteLoaders/PngSheetLoader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/SpriteLoaders/PngSheetLoader.cs b/OpenRA.Mods.Common/SpriteLoaders/PngSheetLoader.cs index 6b4f19158a..409534c3bb 100644 --- a/OpenRA.Mods.Common/SpriteLoaders/PngSheetLoader.cs +++ b/OpenRA.Mods.Common/SpriteLoaders/PngSheetLoader.cs @@ -127,7 +127,7 @@ namespace OpenRA.Mods.Common.SpriteLoaders if (png.EmbeddedData.ContainsKey("FrameAmount")) frameAmount = FieldLoader.GetValue("FrameAmount", png.EmbeddedData["FrameAmount"]); else - frameAmount = png.Width / frameSize.Width * png.Height / frameSize.Height; + frameAmount = (png.Width / frameSize.Width) * (png.Height / frameSize.Height); } else if (png.EmbeddedData.ContainsKey("FrameAmount")) {