Ensure Clear(T) also have a safety check to ensure no listener is attached.

Move related methods next to each other.
Change Clear(T) to use Array.Fill.
This commit is contained in:
RoosterDragon
2021-09-25 13:51:24 +01:00
committed by abcdefg30
parent 19760b04bd
commit 2ed4cb8aff
3 changed files with 29 additions and 21 deletions

View File

@@ -309,6 +309,7 @@ namespace OpenRA
Resources = new CellLayer<ResourceTile>(Grid.Type, size);
Height = new CellLayer<byte>(Grid.Type, size);
Ramp = new CellLayer<byte>(Grid.Type, size);
Tiles.Clear(terrainInfo.DefaultTerrainTile);
if (Grid.MaximumTerrainHeight > 0)
{
Height.CellEntryChanged += UpdateProjection;
@@ -316,8 +317,6 @@ namespace OpenRA
Tiles.CellEntryChanged += UpdateRamp;
}
Tiles.Clear(terrainInfo.DefaultTerrainTile);
PostInit();
}