Fix CA1854
This commit is contained in:
committed by
Pavel Penev
parent
c2568ebd1f
commit
c8efc5fdd7
@@ -96,11 +96,11 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
public bool HasModelSequence(string model, string sequence)
|
||||
{
|
||||
if (!models.ContainsKey(model))
|
||||
if (!models.TryGetValue(model, out var sequences))
|
||||
throw new InvalidOperationException(
|
||||
$"Model `{model}` does not have any sequences defined.");
|
||||
|
||||
return models[model].ContainsKey(sequence);
|
||||
return sequences.ContainsKey(sequence);
|
||||
}
|
||||
|
||||
public IVertexBuffer<ModelVertex> VertexBuffer => loader.VertexBuffer;
|
||||
|
||||
@@ -262,9 +262,9 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
|
||||
var name = entries[1].ToLowerInvariant();
|
||||
|
||||
if (DeployableActors.ContainsKey(name))
|
||||
if (DeployableActors.TryGetValue(name, out var n))
|
||||
{
|
||||
name = DeployableActors[name];
|
||||
name = n;
|
||||
isDeployed = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -91,8 +91,8 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
|
||||
var res = (Type: (byte)0, Index: (byte)0);
|
||||
var type = kv.Value.ToLowerInvariant();
|
||||
if (OverlayResourceMapping.ContainsKey(type))
|
||||
res = OverlayResourceMapping[type];
|
||||
if (OverlayResourceMapping.TryGetValue(type, out var r))
|
||||
res = r;
|
||||
|
||||
Map.Resources[cell] = new ResourceTile(res.Type, res.Index);
|
||||
if (OverlayActors.Contains(type))
|
||||
|
||||
Reference in New Issue
Block a user