Add support for bridge construction
Each movement class is given a crude transientDomain graph. Whenever a bridge state changes, the domain index rebuilds the relevant cells, setting its domain and creating a transient domain connection. This graph is searched as a fallback if the straightforward domain comparison is false. Behavior needs to be double-checked, and ideally destructing connections would be supported, but so far performance and behavior on allies-02 seems good.
This commit is contained in:
@@ -218,6 +218,12 @@ namespace OpenRA.Mods.RA
|
||||
foreach (var c in TileSprites[currentTemplate].Keys)
|
||||
self.World.Map.CustomTerrain[c.X, c.Y] = GetTerrainType(c);
|
||||
|
||||
// If this bridge repair operation connects two pathfinding domains,
|
||||
// update the domain index.
|
||||
var domainIndex = self.World.WorldActor.TraitOrDefault<DomainIndex>();
|
||||
if (domainIndex != null)
|
||||
domainIndex.UpdateCells(self.World, TileSprites[currentTemplate].Keys);
|
||||
|
||||
if (LongBridgeSegmentIsDead() && !killedUnits)
|
||||
{
|
||||
killedUnits = true;
|
||||
|
||||
Reference in New Issue
Block a user