Fix RCS1061
This commit is contained in:
@@ -109,9 +109,10 @@ namespace OpenRA.Mods.Common.Lint
|
||||
}
|
||||
|
||||
foreach (var n in node.Value.Nodes)
|
||||
if (checkArgKeys.Contains(n.Key))
|
||||
if (!namedKeys.Contains(n.Value.Value) && !Hotkey.TryParse(n.Value.Value, out var unused))
|
||||
emitError($"{filename} {node.Value.Value}:{n.Key} refers to a Key named `{n.Value.Value}` that does not exist.");
|
||||
if (checkArgKeys.Contains(n.Key) &&
|
||||
!namedKeys.Contains(n.Value.Value) &&
|
||||
!Hotkey.TryParse(n.Value.Value, out var unused))
|
||||
emitError($"{filename} {node.Value.Value}:{n.Key} refers to a Key named `{n.Value.Value}` that does not exist.");
|
||||
}
|
||||
|
||||
if (node.Value.Nodes != null)
|
||||
|
||||
@@ -40,9 +40,8 @@ namespace OpenRA.Mods.Common.Lint
|
||||
if (!playerNames.Contains(ownerName))
|
||||
emitError($"Actor `{kv.Key}` is owned by unknown player `{ownerName}`.");
|
||||
|
||||
if (actorsWithRequiredOwner.TryGetValue(kv.Value.Value, out var info))
|
||||
if (!info.ValidOwnerNames.Contains(ownerName))
|
||||
emitError($"Actor `{kv.Key}` owner `{ownerName}` is not one of ValidOwnerNames: {info.ValidOwnerNames.JoinWith(", ")}");
|
||||
if (actorsWithRequiredOwner.TryGetValue(kv.Value.Value, out var info) && !info.ValidOwnerNames.Contains(ownerName))
|
||||
emitError($"Actor `{kv.Key}` owner `{ownerName}` is not one of ValidOwnerNames: {info.ValidOwnerNames.JoinWith(", ")}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,9 +256,9 @@ namespace OpenRA.Mods.Common.Lint
|
||||
if (element is Placeable placeable)
|
||||
{
|
||||
var expression = placeable.Expression;
|
||||
if (expression is IInlineExpression inlineExpression)
|
||||
if (inlineExpression is VariableReference variableReference)
|
||||
CheckVariableReference(variableReference.Id.Name.ToString(), key, attribute, emitWarning, file);
|
||||
if (expression is IInlineExpression inlineExpression &&
|
||||
inlineExpression is VariableReference variableReference)
|
||||
CheckVariableReference(variableReference.Id.Name.ToString(), key, attribute, emitWarning, file);
|
||||
|
||||
if (expression is SelectExpression selectExpression)
|
||||
{
|
||||
@@ -269,9 +269,9 @@ namespace OpenRA.Mods.Common.Lint
|
||||
if (variantElement is Placeable variantPlaceable)
|
||||
{
|
||||
var variantExpression = variantPlaceable.Expression;
|
||||
if (variantExpression is IInlineExpression variantInlineExpression)
|
||||
if (variantInlineExpression is VariableReference variantVariableReference)
|
||||
CheckVariableReference(variantVariableReference.Id.Name.ToString(), key, attribute, emitWarning, file);
|
||||
if (variantExpression is IInlineExpression variantInlineExpression &&
|
||||
variantInlineExpression is VariableReference variantVariableReference)
|
||||
CheckVariableReference(variantVariableReference.Id.Name.ToString(), key, attribute, emitWarning, file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user