Fix RCS1134
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -50,8 +50,6 @@ namespace OpenRA.Mods.Common.Activities
|
||||
if (NextActivity != null)
|
||||
foreach (var n in NextActivity.TargetLineNodes(self))
|
||||
yield return n;
|
||||
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -103,8 +103,6 @@ namespace OpenRA.Mods.Common.Activities
|
||||
{
|
||||
foreach (var n in getMove().TargetLineNodes(self))
|
||||
yield return n;
|
||||
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,8 +59,6 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (ChildActivity != null)
|
||||
foreach (var n in ChildActivity.TargetLineNodes(self))
|
||||
yield return n;
|
||||
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ namespace OpenRA.Mods.Common.Activities
|
||||
{
|
||||
base.Cancel(self, keepQueue);
|
||||
Dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -256,8 +256,6 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (NextActivity != null)
|
||||
foreach (var n in NextActivity.TargetLineNodes(self))
|
||||
yield return n;
|
||||
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,10 +181,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
if (!anyProducers)
|
||||
{
|
||||
CancelProduction(unit.Name, 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -131,10 +131,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
if (!anyProducers)
|
||||
{
|
||||
CancelProduction(unit.Name, 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,8 +42,6 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
|
||||
storesResources.AddNode(resources);
|
||||
|
||||
actorNode.AddNode(storesResources);
|
||||
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -570,7 +570,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Write("debug", ex.ToString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user