ECS tags (#6504)
This commit is contained in:
@@ -3,6 +3,7 @@ using Content.Server.Botany.Components;
|
||||
using Content.Server.Chemistry.EntitySystems;
|
||||
using Content.Server.Popups;
|
||||
using Content.Shared.GameTicking;
|
||||
using Content.Shared.Tag;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
@@ -18,6 +19,7 @@ namespace Content.Server.Botany.Systems
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
|
||||
[Dependency] private readonly TagSystem _tags = default!;
|
||||
|
||||
private int _nextUid = 0;
|
||||
private float _timer = 0f;
|
||||
|
||||
@@ -136,7 +136,7 @@ public partial class BotanySystem
|
||||
|
||||
public bool CanHarvest(SeedPrototype proto, EntityUid? held = null)
|
||||
{
|
||||
return !proto.Ligneous || proto.Ligneous && held != null && held.Value.HasTag("BotanySharp");
|
||||
return !proto.Ligneous || proto.Ligneous && held != null && _tags.HasTag(held.Value, "BotanySharp");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -9,6 +9,8 @@ namespace Content.Server.Botany.Systems;
|
||||
|
||||
public sealed class LogSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly TagSystem _tags = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -18,7 +20,7 @@ public sealed class LogSystem : EntitySystem
|
||||
|
||||
private void OnInteractUsing(EntityUid uid, LogComponent component, InteractUsingEvent args)
|
||||
{
|
||||
if (args.Used.HasTag("BotanySharp"))
|
||||
if (_tags.HasTag(args.Used, "BotanySharp"))
|
||||
{
|
||||
for (var i = 0; i < component.SpawnCount; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user