ECS tags (#6504)
This commit is contained in:
@@ -28,10 +28,12 @@ namespace Content.Shared.Construction.Steps
|
||||
if (!entityManager.TryGetComponent(uid, out TagComponent? tags))
|
||||
return false;
|
||||
|
||||
if (_allTags != null && !tags.HasAllTags(_allTags))
|
||||
var tagSystem = EntitySystem.Get<TagSystem>();
|
||||
|
||||
if (_allTags != null && !tagSystem.HasAllTags(tags, _allTags))
|
||||
return false; // We don't have all the tags needed.
|
||||
|
||||
if (_anyTags != null && !tags.HasAnyTag(_anyTags))
|
||||
if (_anyTags != null && !tagSystem.HasAnyTag(tags, _anyTags))
|
||||
return false; // We don't have any of the tags needed.
|
||||
|
||||
// This entity is valid!
|
||||
|
||||
@@ -12,7 +12,8 @@ namespace Content.Shared.Construction.Steps
|
||||
|
||||
public override bool EntityValid(EntityUid uid, IEntityManager entityManager)
|
||||
{
|
||||
return !string.IsNullOrEmpty(_tag) && entityManager.TryGetComponent(uid, out TagComponent? tags) && tags.HasTag(_tag);
|
||||
var tagSystem = EntitySystem.Get<TagSystem>();
|
||||
return !string.IsNullOrEmpty(_tag) && tagSystem.HasTag(uid, _tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user