Use long in CellLayerUtils.CalibrateQuantileInPlace index calculation
This is similar to #21727, but in CellLayerUtils instead of MatrixUtils. Note that the lack of long does not result in any overflows/crashes in existing code, but can cause crashes for new features requiring larger calculations.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
052c74e2d7
commit
1f65fd234b
@@ -275,7 +275,7 @@ namespace OpenRA.Mods.Common.MapGenerator
|
||||
{
|
||||
var sorted = Entries(cellLayer);
|
||||
Array.Sort(sorted);
|
||||
var adjustment = target - sorted[(sorted.Length - 1) * count / outOf];
|
||||
var adjustment = target - sorted[(long)(sorted.Length - 1) * count / outOf];
|
||||
foreach (var mpos in cellLayer.CellRegion.MapCoords)
|
||||
cellLayer[mpos] += adjustment;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user