From b74ff33039b6d3610b25fcf75695cb42a4f097a0 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 27 Dec 2018 10:27:31 +1300 Subject: [PATCH] Revert "Fix QuantizeFacing returning values >= numFacings." This reverts commit f35ee8c30325f478d8bcd4bdf6772c543c3c1691. --- OpenRA.Mods.Common/Util.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/OpenRA.Mods.Common/Util.cs b/OpenRA.Mods.Common/Util.cs index 30bf469657..9a007dbcb0 100644 --- a/OpenRA.Mods.Common/Util.cs +++ b/OpenRA.Mods.Common/Util.cs @@ -49,10 +49,8 @@ namespace OpenRA.Mods.Common public static int QuantizeFacing(int facing, int numFrames) { var step = 256 / numFrames; - var f = NormalizeFacing(facing + step / 2) / step; - - // f may be >= numFrames so wrap it back in range - return f % numFrames; + var a = (facing + step / 2) & 0xff; + return a / step; } public static int QuantizeFacing(int facing, int numFrames, bool useClassicFacingFudge)