Improve robustness of editor actor cell checks.

This commit is contained in:
Paul Chote
2019-12-26 12:53:02 +00:00
committed by abcdefg30
parent 1282650274
commit fe25fdf0ff
2 changed files with 18 additions and 4 deletions

View File

@@ -263,8 +263,16 @@ namespace OpenRA.Mods.Common.Traits
return map.Grid.DefaultSubCell;
for (var i = (byte)SubCell.First; i < map.Grid.SubCellOffsets.Length; i++)
if (!previews.Any(p => p.Footprint[cell] == (SubCell)i))
{
var blocked = previews.Any(p =>
{
SubCell s;
return p.Footprint.TryGetValue(cell, out s) && s == (SubCell)i;
});
if (!blocked)
return (SubCell)i;
}
return SubCell.Invalid;
}