* garland

* presents filter
This commit is contained in:
Ed
2024-12-13 22:20:00 +03:00
committed by GitHub
parent e30c5848c5
commit 4cea96f6eb
6 changed files with 139 additions and 0 deletions

View File

@@ -92,6 +92,9 @@ public sealed class RandomGiftSystem : EntitySystem
var mapGridCompName = _componentFactory.GetComponentName(typeof(MapGridComponent));
var physicsCompName = _componentFactory.GetComponentName(typeof(PhysicsComponent));
if (!_prototype.TryIndex<EntityCategoryPrototype>("ForkFiltered", out var indexedFilter))
return;
foreach (var proto in _prototype.EnumeratePrototypes<EntityPrototype>())
{
if (proto.Abstract || proto.HideSpawnMenu || proto.Components.ContainsKey(mapGridCompName) || !proto.Components.ContainsKey(physicsCompName))
@@ -102,6 +105,11 @@ public sealed class RandomGiftSystem : EntitySystem
if (!proto.Components.ContainsKey(itemCompName))
continue;
//CP14 Only cp14 items
if (!proto.Categories.Contains(indexedFilter))
continue;
//CP14 end
_possibleGiftsSafe.Add(proto.ID);
}
}