Compare commits

...

9 Commits

3 changed files with 28 additions and 11 deletions

View File

@@ -202,6 +202,7 @@ namespace Content.IntegrationTests.Tests
// TODO MAP TESTS
// Move this to some separate test?
CheckDoNotMap(map, root, protoManager);
CP14CheckOnlyForkFiltered(map, root, protoManager);
if (version >= 7)
{
@@ -270,6 +271,32 @@ namespace Content.IntegrationTests.Tests
});
}
private void CP14CheckOnlyForkFiltered(ResPath map, YamlNode node, IPrototypeManager protoManager)
{
//ignore all vanilla maps
if (!map.ToString().Contains("CP14"))
return;
var yamlEntities = node["entities"];
if (!protoManager.TryIndex<EntityCategoryPrototype>("ForkFiltered", out var filterCategory))
return;
Assert.Multiple(() =>
{
foreach (var yamlEntity in (YamlSequenceNode)yamlEntities)
{
var protoId = yamlEntity["proto"].AsString();
// This doesn't properly handle prototype migrations, but thats not a significant issue.
if (!protoManager.TryIndex(protoId, out var proto, false))
continue;
Assert.That(proto.Categories.Contains(filterCategory),
$"\nMap {map} contains entities without FORK FILTERED category ({proto.Name})");
}
});
}
private bool IsPreInit(ResPath map,
MapLoaderSystem loader,
IDependencyCollection deps,

View File

@@ -58067,7 +58067,7 @@ entities:
- type: Transform
pos: 106.5,42.5
parent: 1
- proto: DeskBell
- proto: CP14Bell
entities:
- uid: 9141
components:

View File

@@ -122858,14 +122858,4 @@ entities:
rot: 1.5707963267948966 rad
pos: -7.5,-35.5
parent: 1
- proto: PlushieLizardInversed
entities:
- uid: 23369
components:
- type: MetaData
desc: oooo you like mapping. ur a mapper
name: Viator
- type: Transform
pos: -52.729527,-71.3009
parent: 1
...