Fix CA1854

This commit is contained in:
RoosterDragon
2023-11-15 19:46:36 +00:00
committed by Pavel Penev
parent c2568ebd1f
commit c8efc5fdd7
19 changed files with 44 additions and 48 deletions

View File

@@ -59,9 +59,9 @@ namespace OpenRA.Mods.Common.Traits
{
var key = MakeKey(t);
if (!Powers.ContainsKey(key))
if (!Powers.TryGetValue(key, out var spi))
{
Powers.Add(key, t.CreateInstance(key, this));
Powers.Add(key, spi = t.CreateInstance(key, this));
if (t.Info.Prerequisites.Length > 0)
{
@@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.Traits
}
}
Powers[key].Instances.Add(t);
spi.Instances.Add(t);
}
}