diff --git a/OpenRA.Mods.Common/MapGenerator/TilingPath.cs b/OpenRA.Mods.Common/MapGenerator/TilingPath.cs index 2e03c05cec..85453d77be 100644 --- a/OpenRA.Mods.Common/MapGenerator/TilingPath.cs +++ b/OpenRA.Mods.Common/MapGenerator/TilingPath.cs @@ -803,7 +803,10 @@ namespace OpenRA.Mods.Common.MapGenerator } Debug.Assert(candidates.Count >= 1, "TraceBack didn't find an original route"); - var chosenSegment = candidates[random.Next(candidates.Count)]; + var weights = candidates + .Select(c => c.MultiBrush.Weight) + .ToArray(); + var chosenSegment = candidates[random.PickWeighted(weights)]; var chosenFrom = to - chosenSegment.Moves; compositeBrush.MergeFrom( chosenSegment.MultiBrush,