From 41d7a2d429c9108fc0b432f2067fcccaa7d1c0dd Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 15 Feb 2020 13:41:32 +0000 Subject: [PATCH] Fix an integer overflow when calculating selection priorities. --- OpenRA.Game/SelectableExts.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Game/SelectableExts.cs b/OpenRA.Game/SelectableExts.cs index 5c0959aa05..812b88982b 100644 --- a/OpenRA.Game/SelectableExts.cs +++ b/OpenRA.Game/SelectableExts.cs @@ -83,7 +83,7 @@ namespace OpenRA.Traits bounds.Top + bounds.Size.Height / 2); var pixelDistance = (centerPixel - selectionPixel).Length; - return ((long)-pixelDistance << 32) + info.SelectionPriority(modifiers); + return info.SelectionPriority(modifiers) - (long)pixelDistance << 16; } static readonly Actor[] NoActors = { };