Use Null-Propagation Operator
This commit is contained in:
@@ -158,8 +158,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
cell.Density = Math.Min(cell.Type.Info.MaxDensity, cell.Density + n);
|
||||
Content[p] = cell;
|
||||
|
||||
if (CellChanged != null)
|
||||
CellChanged(p, cell.Type);
|
||||
CellChanged?.Invoke(p, cell.Type);
|
||||
}
|
||||
|
||||
public bool IsFull(CPos cell)
|
||||
@@ -183,8 +182,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
else
|
||||
Content[cell] = c;
|
||||
|
||||
if (CellChanged != null)
|
||||
CellChanged(cell, c.Type);
|
||||
CellChanged?.Invoke(cell, c.Type);
|
||||
|
||||
return c.Type;
|
||||
}
|
||||
@@ -202,8 +200,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Content[cell] = ResourceLayerContents.Empty;
|
||||
world.Map.CustomTerrain[cell] = byte.MaxValue;
|
||||
|
||||
if (CellChanged != null)
|
||||
CellChanged(cell, c.Type);
|
||||
CellChanged?.Invoke(cell, c.Type);
|
||||
}
|
||||
|
||||
public ResourceType GetResourceType(CPos cell) { return Content[cell].Type; }
|
||||
|
||||
Reference in New Issue
Block a user