From 0052000f7bd62ab2a1c845823bd31ba108ae1244 Mon Sep 17 00:00:00 2001 From: Curtis Shmyr Date: Fri, 21 Feb 2014 17:54:27 -0700 Subject: [PATCH] Flood fill now treats similar grass/snow/desert tiles as the same - fixes #4695 --- CHANGELOG | 1 + OpenRA.Editor/BrushTool.cs | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index ede07e3ac0..014c926121 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -57,6 +57,7 @@ NEW: Filenames are now listed in alphabetical order Map Editor: Removed legacy INI/MPR map import. + Fixed being unable to use the flood fill tool on similar grass/snow/desert tiles. Utility: Added an improved INI/MPR map import. Mod / Custom map compatibility: diff --git a/OpenRA.Editor/BrushTool.cs b/OpenRA.Editor/BrushTool.cs index 5139eac0eb..d094d508a1 100644 --- a/OpenRA.Editor/BrushTool.cs +++ b/OpenRA.Editor/BrushTool.cs @@ -88,7 +88,7 @@ namespace OpenRA.Editor while (queue.Count > 0) { var p = queue.Dequeue(); - if (!s.Map.MapTiles.Value[p.X, p.Y].Equals(replace)) + if (s.Map.MapTiles.Value[p.X, p.Y].Type != replace.Type) continue; var a = FindEdge(s, p, new CVec(-1, 0), replace); @@ -97,9 +97,9 @@ namespace OpenRA.Editor for (var x = a.X; x <= b.X; x++) { s.Map.MapTiles.Value[x, p.Y] = new TileReference { Type = brushTemplate.N, Index = (byte)0 }; - if (s.Map.MapTiles.Value[x, p.Y - 1].Equals(replace)) + if (s.Map.MapTiles.Value[x, p.Y - 1].Type == replace.Type) maybeEnqueue(x, p.Y - 1); - if (s.Map.MapTiles.Value[x, p.Y + 1].Equals(replace)) + if (s.Map.MapTiles.Value[x, p.Y + 1].Type == replace.Type) maybeEnqueue(x, p.Y + 1); } } @@ -115,7 +115,7 @@ namespace OpenRA.Editor { var q = p + d; if (!s.Map.IsInMap(q)) return p; - if (!s.Map.MapTiles.Value[q.X, q.Y].Equals(replace)) return p; + if (s.Map.MapTiles.Value[q.X, q.Y].Type != replace.Type) return p; p = q; } }