Fix IDE0030
This commit is contained in:
committed by
Pavel Penev
parent
8223161959
commit
99c1a4448b
@@ -156,6 +156,9 @@ dotnet_diagnostic.IDE0028.severity = warning
|
|||||||
# Use coalesce expression (non-nullable types).
|
# Use coalesce expression (non-nullable types).
|
||||||
dotnet_diagnostic.IDE0029.severity = warning
|
dotnet_diagnostic.IDE0029.severity = warning
|
||||||
|
|
||||||
|
# Use coalesce expression (nullable types).
|
||||||
|
dotnet_diagnostic.IDE0030.severity = warning
|
||||||
|
|
||||||
# Simplify 'default' expression
|
# Simplify 'default' expression
|
||||||
dotnet_diagnostic.IDE0034.severity = warning
|
dotnet_diagnostic.IDE0034.severity = warning
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Scripting.Global
|
|||||||
var luaLabel = Ui.Root.Get("INGAME_ROOT").Get<LabelWidget>("MISSION_TEXT");
|
var luaLabel = Ui.Root.Get("INGAME_ROOT").Get<LabelWidget>("MISSION_TEXT");
|
||||||
luaLabel.GetText = () => text;
|
luaLabel.GetText = () => text;
|
||||||
|
|
||||||
var c = color.HasValue ? color.Value : Color.White;
|
var c = color ?? Color.White;
|
||||||
luaLabel.GetColor = () => c;
|
luaLabel.GetColor = () => c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ namespace OpenRA.Mods.Common.Terrain
|
|||||||
if (r.Index >= template.Stride)
|
if (r.Index >= template.Stride)
|
||||||
return missingTile;
|
return missingTile;
|
||||||
|
|
||||||
var start = template.Variants > 1 ? variant.HasValue ? variant.Value : random.Next(template.Variants) : 0;
|
var start = template.Variants > 1 ? variant ?? random.Next(template.Variants) : 0;
|
||||||
return template.Sprites[start * template.Stride + r.Index];
|
return template.Sprites[start * template.Stride + r.Index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
if (unitGroup.BaseActor != null)
|
if (unitGroup.BaseActor != null)
|
||||||
{
|
{
|
||||||
var facing = unitGroup.BaseActorFacing.HasValue ? unitGroup.BaseActorFacing.Value : new WAngle(w.SharedRandom.Next(1024));
|
var facing = unitGroup.BaseActorFacing ?? new WAngle(w.SharedRandom.Next(1024));
|
||||||
w.CreateActor(unitGroup.BaseActor.ToLowerInvariant(), new TypeDictionary
|
w.CreateActor(unitGroup.BaseActor.ToLowerInvariant(), new TypeDictionary
|
||||||
{
|
{
|
||||||
new LocationInit(p.HomeLocation + unitGroup.BaseActorOffset),
|
new LocationInit(p.HomeLocation + unitGroup.BaseActorOffset),
|
||||||
@@ -115,7 +115,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
}
|
}
|
||||||
|
|
||||||
var subCell = ip.SharesCell ? w.ActorMap.FreeSubCell(validCell) : 0;
|
var subCell = ip.SharesCell ? w.ActorMap.FreeSubCell(validCell) : 0;
|
||||||
var facing = unitGroup.SupportActorsFacing.HasValue ? unitGroup.SupportActorsFacing.Value : new WAngle(w.SharedRandom.Next(1024));
|
var facing = unitGroup.SupportActorsFacing ?? new WAngle(w.SharedRandom.Next(1024));
|
||||||
|
|
||||||
w.CreateActor(s.ToLowerInvariant(), new TypeDictionary
|
w.CreateActor(s.ToLowerInvariant(), new TypeDictionary
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user