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

@@ -380,17 +380,17 @@ namespace OpenRA
if (voicedActor != null)
{
if (!rules.VoicePools.Value.ContainsKey(definition))
if (!rules.VoicePools.Value.TryGetValue(definition, out var p))
throw new InvalidOperationException($"Can't find {definition} in voice pool.");
pool = rules.VoicePools.Value[definition];
pool = p;
}
else
{
if (!rules.NotificationsPools.Value.ContainsKey(definition))
if (!rules.NotificationsPools.Value.TryGetValue(definition, out var p))
throw new InvalidOperationException($"Can't find {definition} in notification pool.");
pool = rules.NotificationsPools.Value[definition];
pool = p;
}
var clip = pool.GetNext();