yaml linter fix & alert sprite specifier changes (#10015)
* Sprite specifier/serializer update * Immume * Fix tests * hooray, more bad test prototypes * add some comments
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
@@ -88,15 +88,28 @@ namespace Content.YAMLLinter
|
||||
|
||||
foreach (var (key, val) in serverErrors)
|
||||
{
|
||||
// Include all server errors marked as always relevant
|
||||
var newErrors = val.Where(n => n.AlwaysRelevant).ToHashSet();
|
||||
if (clientErrors.TryGetValue(key, out var clientVal))
|
||||
{
|
||||
newErrors.UnionWith(val.Intersect(clientVal));
|
||||
newErrors.UnionWith(clientVal.Where(n => n.AlwaysRelevant));
|
||||
}
|
||||
|
||||
if (newErrors.Count == 0) continue;
|
||||
allErrors[key] = newErrors;
|
||||
// We include sometimes-relevant errors if they exist both for the client & server
|
||||
if (clientErrors.TryGetValue(key, out var clientVal))
|
||||
newErrors.UnionWith(val.Intersect(clientVal));
|
||||
|
||||
if (newErrors.Count != 0)
|
||||
allErrors[key] = newErrors;
|
||||
}
|
||||
|
||||
// Finally add any always-relevant client errors.
|
||||
foreach (var (key, val) in clientErrors)
|
||||
{
|
||||
var newErrors = val.Where(n => n.AlwaysRelevant).ToHashSet();
|
||||
if (newErrors.Count == 0)
|
||||
continue;
|
||||
|
||||
if (allErrors.TryGetValue(key, out var errors))
|
||||
errors.UnionWith(val.Where(n => n.AlwaysRelevant));
|
||||
else
|
||||
allErrors[key] = newErrors;
|
||||
}
|
||||
|
||||
return allErrors;
|
||||
|
||||
Reference in New Issue
Block a user