Fix MagazineVisualsSpritesExist for engine PR (#36761)

This commit is contained in:
Leon Friedrich
2025-05-10 21:40:27 +10:00
committed by GitHub
parent 603eb284d5
commit f0a7123208
2 changed files with 22 additions and 14 deletions

View File

@@ -111,9 +111,16 @@ public sealed partial class TestPair
HashSet<string>? ignored = null,
bool ignoreAbstract = true,
bool ignoreTestPrototypes = true)
where T : IComponent
where T : IComponent, new()
{
var id = Server.ResolveDependency<IComponentFactory>().GetComponentName(typeof(T));
if (!Server.ResolveDependency<IComponentFactory>().TryGetRegistration<T>(out var reg)
&& !Client.ResolveDependency<IComponentFactory>().TryGetRegistration<T>(out reg))
{
Assert.Fail($"Unknown component: {typeof(T).Name}");
return new();
}
var id = reg.Name;
var list = new List<(EntityPrototype, T)>();
foreach (var proto in Server.ProtoMan.EnumeratePrototypes<EntityPrototype>())
{