This commit is contained in:
metalgearsloth
2022-02-08 14:08:11 +11:00
committed by GitHub
parent ef6aa43031
commit 70c0a502cf
24 changed files with 641 additions and 628 deletions

View File

@@ -1,14 +1,9 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Threading.Tasks;
using Content.Server.Stack;
using Content.Shared.Construction;
using Content.Shared.Interaction;
using Content.Shared.Tag;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
namespace Content.Server.Construction.Components
{
@@ -236,10 +231,12 @@ namespace Content.Server.Construction.Components
_componentProgress[compName]++;
}
var tagSystem = EntitySystem.Get<TagSystem>();
// I have MANY regrets.
foreach (var (tagName, _) in TagRequirements)
{
if (!part.HasTag(tagName))
if (!tagSystem.HasTag(part, tagName))
continue;
if (!_tagProgress.ContainsKey(tagName))
@@ -339,12 +336,14 @@ namespace Content.Server.Construction.Components
return true;
}
var tags = EntitySystem.Get<TagSystem>();
foreach (var (tagName, info) in TagRequirements)
{
if (_tagProgress[tagName] >= info.Amount)
continue;
if (!eventArgs.Using.HasTag(tagName))
if (!tags.HasTag(eventArgs.Using, tagName))
continue;
if (!eventArgs.Using.TryRemoveFromContainer() || !_partContainer.Insert(eventArgs.Using)) continue;