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. # Remove redundant Dispose/Close call.
dotnet_diagnostic.RCS1133.severity = warning dotnet_diagnostic.RCS1133.severity = warning
# Remove redundant statement.
dotnet_diagnostic.RCS1134.severity = warning
# Merge switch sections with equivalent content. # Merge switch sections with equivalent content.
dotnet_diagnostic.RCS1136.severity = warning dotnet_diagnostic.RCS1136.severity = warning

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -23,8 +23,6 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{ {
if (actorNode.RemoveNodes("LaysTerrain") > 0) if (actorNode.RemoveNodes("LaysTerrain") > 0)
yield return $"'LaysTerrain' was removed from {actorNode.Key} ({actorNode.Location.Filename}) without replacement.\n"; 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); storesResources.AddNode(resources);
actorNode.AddNode(storesResources); 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}, " Log.Write("debug", $"Map editor ignoring actor {actor.Name}, "
+ $"because of missing sprites for tileset {World.Map.Rules.TerrainInfo.Id}."); + $"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) catch (Exception ex)
{ {
Log.Write("debug", ex.ToString()); Log.Write("debug", ex.ToString());
return;
} }
} }