else
if not <| Object.ReferenceEquals(other, null)
then // We touching another island.
- if island.IsInfinite || other.IsInfinite || island.Surface + other.Surface >= area
+ if island.IsInfinite || other.IsInfinite || island.Surface + other.Surface >= area || comparer.Compare(island.Level, other.Level) < 0
then
stop <- true
else // We can merge 'other' into 'surface'.
island.Surface <- island.Surface + other.Surface
- island.Level <- if comparer.Compare(island.Level, other.Level) > 0 then island.Level else other.Level
+ island.Level <- other.Level
+ // island.Level <- if comparer.Compare(island.Level, other.Level) > 0 then other.Level else island.Level
for l, p in other.Shore do
let mutable currentY = p.Y + 1
while currentY < h && ownership.[currentY, p.X] = other do