diff --git a/Content.IntegrationTests/Tests/PostMapInitTest.cs b/Content.IntegrationTests/Tests/PostMapInitTest.cs index 0b3a4d181fb..28ee1c3bb3e 100644 --- a/Content.IntegrationTests/Tests/PostMapInitTest.cs +++ b/Content.IntegrationTests/Tests/PostMapInitTest.cs @@ -222,6 +222,7 @@ public async Task NoSavedPostMapInitTest() // TODO MAP TESTS // Move this to some separate test? CheckDoNotMap(map, root, protoManager); + CECheckOnlyForkFiltered(map, root, protoManager); //CrystallEdge if (version >= 7) { @@ -270,6 +271,35 @@ private bool IsWhitelistedForMap(EntProtoId protoId, ResPath map) return allowedProtos.Contains(protoId); } + /// + /// CrystallEdge - we ensure that maps don't have any vanilla entities + /// + private void CECheckOnlyForkFiltered(ResPath map, YamlNode node, IPrototypeManager protoManager) + { + //ignore all vanilla maps + if (!map.ToString().Contains("_CE")) + return; + + var yamlEntities = node["entities"]; + if (!protoManager.TryIndex("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})"); + } + }); + } + /// /// Check that maps do not have any entities that belong to the DoNotMap entity category ///