Remove Enum.HasFlag from building preview generation.

This commit is contained in:
Paul Chote
2019-05-21 22:39:19 +01:00
committed by reaperrr
parent 697935f931
commit 6723306bb4
2 changed files with 10 additions and 4 deletions

View File

@@ -74,11 +74,11 @@ namespace OpenRA.Mods.Common.Traits
if ((c.Value & filter) == 0)
continue;
var tile = c.Value.HasFlag(PlaceBuildingCellType.Invalid) ? buildBlocked :
var tile = HasFlag(c.Value, PlaceBuildingCellType.Invalid) ? buildBlocked :
candidateSafeTiles.Contains(c.Key) && info.UnsafeTerrainTypes.Contains(wr.World.Map.GetTerrainInfo(c.Key).Type)
? buildUnsafe : buildOk;
var pal = c.Value.HasFlag(PlaceBuildingCellType.LineBuild) ? linePalette : cellPalette;
var pal = HasFlag(c.Value, PlaceBuildingCellType.LineBuild) ? linePalette : cellPalette;
var pos = wr.World.Map.CenterOfCell(c.Key);
var offset = new WVec(0, 0, topLeftPos.Z - pos.Z);
yield return new SpriteRenderable(tile, pos, offset, -511, pal, 1f, true);