Fix a crash with support powers and units without selection decorations
This commit is contained in:
@@ -155,8 +155,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
foreach (var unit in power.UnitsInRange(xy))
|
||||
{
|
||||
var decorations = unit.TraitsImplementing<ISelectionDecorations>().FirstEnabledTraitOrDefault();
|
||||
foreach (var d in decorations.RenderSelectionAnnotations(unit, wr, Color.Red))
|
||||
yield return d;
|
||||
if (decorations != null)
|
||||
foreach (var d in decorations.RenderSelectionAnnotations(unit, wr, Color.Red))
|
||||
yield return d;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user