Fix RCS1134

This commit is contained in:
RoosterDragon
2023-03-18 12:59:14 +00:00
committed by Gustas
parent 11b59b0a65
commit fcfee31972
16 changed files with 58 additions and 85 deletions

View File

@@ -1031,6 +1031,9 @@ dotnet_diagnostic.RCS1132.severity = warning
# Remove redundant Dispose/Close call.
dotnet_diagnostic.RCS1133.severity = warning
# Remove redundant statement.
dotnet_diagnostic.RCS1134.severity = warning
# Merge switch sections with equivalent content.
dotnet_diagnostic.RCS1136.severity = warning

View File

@@ -204,8 +204,6 @@ namespace OpenRA.Mods.Cnc.Traits
cursor = targetCursor;
return true;
}
return false;
}
return false;
@@ -252,7 +250,6 @@ namespace OpenRA.Mods.Cnc.Traits
if (portableChrono.IsTraitDisabled || portableChrono.IsTraitPaused)
{
world.CancelInputMode();
return;
}
}

View File

@@ -34,10 +34,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
public override void ValidateMapFormat(int format)
{
if (format < 2)
{
Console.WriteLine($"ERROR: Detected NewINIFormat {format}. Are you trying to import a Tiberian Dawn map?");
return;
}
}
// Mapping from RA95 overlay index to type string
@@ -146,46 +143,46 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
string faction;
switch (section)
{
case "Spain":
color = "gold";
faction = "allies";
break;
case "England":
color = "green";
faction = "allies";
break;
case "Ukraine":
color = "orange";
faction = "soviet";
break;
case "Germany":
color = "black";
faction = "allies";
break;
case "France":
color = "teal";
faction = "allies";
break;
case "Turkey":
color = "salmon";
faction = "allies";
break;
case "Greece":
case "GoodGuy":
color = "blue";
faction = "allies";
break;
case "USSR":
case "BadGuy":
color = "red";
faction = "soviet";
break;
case "Special":
case "Neutral":
default:
color = "neutral";
faction = "allies";
break;
case "Spain":
color = "gold";
faction = "allies";
break;
case "England":
color = "green";
faction = "allies";
break;
case "Ukraine":
color = "orange";
faction = "soviet";
break;
case "Germany":
color = "black";
faction = "allies";
break;
case "France":
color = "teal";
faction = "allies";
break;
case "Turkey":
color = "salmon";
faction = "allies";
break;
case "Greece":
case "GoodGuy":
color = "blue";
faction = "allies";
break;
case "USSR":
case "BadGuy":
color = "red";
faction = "soviet";
break;
case "Special":
case "Neutral":
default:
color = "neutral";
faction = "allies";
break;
}
SetMapPlayers(section, faction, color, file, Players, MapPlayers);

View File

@@ -32,10 +32,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
public override void ValidateMapFormat(int format)
{
if (format > 1)
{
Console.WriteLine($"ERROR: Detected NewINIFormat {format}. Are you trying to import a Red Alert map?");
return;
}
}
static readonly Dictionary<string, (byte Type, byte Index)> OverlayResourceMapping = new()
@@ -145,20 +142,20 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
string faction;
switch (section)
{
case "GoodGuy":
color = "gold";
faction = "gdi";
break;
case "BadGuy":
color = "red";
faction = "nod";
break;
case "Special":
case "Neutral":
default:
color = "neutral";
faction = "gdi";
break;
case "GoodGuy":
color = "gold";
faction = "gdi";
break;
case "BadGuy":
color = "red";
faction = "nod";
break;
case "Special":
case "Neutral":
default:
color = "neutral";
faction = "gdi";
break;
}
SetMapPlayers(section, faction, color, file, Players, MapPlayers);

View File

@@ -50,8 +50,6 @@ namespace OpenRA.Mods.Common.Activities
if (NextActivity != null)
foreach (var n in NextActivity.TargetLineNodes(self))
yield return n;
yield break;
}
}

View File

@@ -103,8 +103,6 @@ namespace OpenRA.Mods.Common.Activities
{
foreach (var n in getMove().TargetLineNodes(self))
yield return n;
yield break;
}
}
}

View File

@@ -59,8 +59,6 @@ namespace OpenRA.Mods.Common.Traits
if (ChildActivity != null)
foreach (var n in ChildActivity.TargetLineNodes(self))
yield return n;
yield break;
}
}
}

View File

@@ -46,7 +46,6 @@ namespace OpenRA.Mods.Common.Activities
{
base.Cancel(self, keepQueue);
Dispose();
return;
}
public void Dispose()

View File

@@ -313,7 +313,7 @@ namespace OpenRA.Mods.Common.Traits
Uncloak();
}
void INotifySupportPower.Charged(Actor self) { return; }
void INotifySupportPower.Charged(Actor self) { }
void INotifySupportPower.Activated(Actor self)
{

View File

@@ -256,8 +256,6 @@ namespace OpenRA.Mods.Common.Traits
if (NextActivity != null)
foreach (var n in NextActivity.TargetLineNodes(self))
yield return n;
yield break;
}
}
}

View File

@@ -181,10 +181,7 @@ namespace OpenRA.Mods.Common.Traits
}
if (!anyProducers)
{
CancelProduction(unit.Name, 1);
return false;
}
return false;
}

View File

@@ -131,10 +131,7 @@ namespace OpenRA.Mods.Common.Traits
}
if (!anyProducers)
{
CancelProduction(unit.Name, 1);
return false;
}
return false;
}

View File

@@ -23,8 +23,6 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
if (actorNode.RemoveNodes("LaysTerrain") > 0)
yield return $"'LaysTerrain' was removed from {actorNode.Key} ({actorNode.Location.Filename}) without replacement.\n";
yield break;
}
}
}

View File

@@ -42,8 +42,6 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
storesResources.AddNode(resources);
actorNode.AddNode(storesResources);
yield break;
}
}
}

View File

@@ -225,7 +225,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
Log.Write("debug", $"Map editor ignoring actor {actor.Name}, "
+ $"because of missing sprites for tileset {World.Map.Rules.TerrainInfo.Id}.");
continue;
}
}
}

View File

@@ -570,7 +570,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
catch (Exception ex)
{
Log.Write("debug", ex.ToString());
return;
}
}