Fix an integer overflow when calculating selection priorities.

This commit is contained in:
Paul Chote
2020-02-15 13:41:32 +00:00
committed by reaperrr
parent 7cec1b771d
commit 41d7a2d429

View File

@@ -83,7 +83,7 @@ namespace OpenRA.Traits
bounds.Top + bounds.Size.Height / 2); bounds.Top + bounds.Size.Height / 2);
var pixelDistance = (centerPixel - selectionPixel).Length; var pixelDistance = (centerPixel - selectionPixel).Length;
return ((long)-pixelDistance << 32) + info.SelectionPriority(modifiers); return info.SelectionPriority(modifiers) - (long)pixelDistance << 16;
} }
static readonly Actor[] NoActors = { }; static readonly Actor[] NoActors = { };