Fix IDE0075
This commit is contained in:
committed by
Pavel Penev
parent
3402031399
commit
99c289e063
@@ -201,6 +201,9 @@ dotnet_diagnostic.IDE0061.severity = warning
|
|||||||
# Simplify interpolation.
|
# Simplify interpolation.
|
||||||
dotnet_diagnostic.IDE0071.severity = warning
|
dotnet_diagnostic.IDE0071.severity = warning
|
||||||
|
|
||||||
|
# Simplify conditional expression.
|
||||||
|
dotnet_diagnostic.IDE0075.severity = warning
|
||||||
|
|
||||||
# Naming rule violation.
|
# Naming rule violation.
|
||||||
dotnet_diagnostic.IDE1006.severity = warning
|
dotnet_diagnostic.IDE1006.severity = warning
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Cnc.Effects
|
|||||||
if (frozenLayer != null)
|
if (frozenLayer != null)
|
||||||
{
|
{
|
||||||
var frozenActor = frozenLayer.FromID(a.ActorID);
|
var frozenActor = frozenLayer.FromID(a.ActorID);
|
||||||
FrozenActorWithRenderables = frozenActor != null ? frozenActor.HasRenderables : false;
|
FrozenActorWithRenderables = frozenActor != null && frozenActor.HasRenderables;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
// Check if color has a (valid) alpha value.
|
// Check if color has a (valid) alpha value.
|
||||||
// Note: We can't throw on "rgba.Length > 3 but parse failed", because in GIMP palettes the 'invalid' value is probably a color name string.
|
// Note: We can't throw on "rgba.Length > 3 but parse failed", because in GIMP palettes the 'invalid' value is probably a color name string.
|
||||||
var noAlpha = rgba.Length > 3 ? !byte.TryParse(rgba[3], out a) : true;
|
var noAlpha = rgba.Length <= 3 || !byte.TryParse(rgba[3], out a);
|
||||||
|
|
||||||
// Index should be completely transparent/background color
|
// Index should be completely transparent/background color
|
||||||
if (i == TransparentIndex)
|
if (i == TransparentIndex)
|
||||||
|
|||||||
Reference in New Issue
Block a user