Replace ResourceLayer references with IResourceLayer in traits/warheads.

This commit is contained in:
Paul Chote
2021-03-07 17:31:26 +00:00
committed by reaperrr
parent 5adcbe4c78
commit dcd8eccee4
14 changed files with 72 additions and 80 deletions

View File

@@ -34,14 +34,14 @@ namespace OpenRA.Mods.Common.Warheads
return;
var targetTile = world.Map.CellContaining(pos);
var resLayer = world.WorldActor.Trait<ResourceLayer>();
var resourceLayer = world.WorldActor.Trait<IResourceLayer>();
var minRange = (Size.Length > 1 && Size[1] > 0) ? Size[1] : 0;
var allCells = world.Map.FindTilesInAnnulus(targetTile, minRange, Size[0]);
// Destroy all resources in the selected tiles
foreach (var cell in allCells)
resLayer.ClearResources(cell);
resourceLayer.ClearResources(cell);
}
}
}