Fix line build for multi-cell neighbours.

This commit is contained in:
Paul Chote
2015-11-20 22:46:21 +00:00
committed by teees
parent 085367ced6
commit 963a92214d
2 changed files with 8 additions and 6 deletions

View File

@@ -71,12 +71,11 @@ namespace OpenRA.Mods.Common.Traits
continue; // Cell is empty; continue search
// Cell contains an actor. Is it the type we want?
if (world.ActorsHavingTrait<LineBuildNode>()
.Any(a => a.Location == cell
&& a.Info.TraitInfo<LineBuildNodeInfo>().Types.Overlaps(lbi.NodeTypes)))
dirs[d] = i; // Cell contains actor of correct type
else
dirs[d] = -1; // Cell is blocked by another actor type
var hasConnector = world.ActorMap.GetActorsAt(cell)
.Any(a => a.Info.TraitInfos<LineBuildNodeInfo>()
.Any(info => info.Types.Overlaps(lbi.NodeTypes) && info.Connections.Contains(vecs[d])));
dirs[d] = hasConnector ? i : -1;
}
// Place intermediate-line sections