Fix CA1854

This commit is contained in:
RoosterDragon
2023-03-12 17:38:38 +00:00
committed by abcdefg30
parent 56fe08cb00
commit 231bf01f18
26 changed files with 93 additions and 86 deletions

View File

@@ -367,9 +367,8 @@ namespace OpenRA.Mods.D2k.UtilityCommands
map.Resources[locationOnMap] = new ResourceTile(1, 2);
// Actors
if (ActorDataByActorCode.ContainsKey(tileSpecialInfo))
if (ActorDataByActorCode.TryGetValue(tileSpecialInfo, out var kvp))
{
var kvp = ActorDataByActorCode[tileSpecialInfo];
if (!rules.Actors.ContainsKey(kvp.Actor.ToLowerInvariant()))
Console.WriteLine($"Ignoring unknown actor type: `{kvp.Actor.ToLowerInvariant()}`");
else