Extracts magic strings from Tag calls (#36305)
* Extracts magic strings from Tag calls When #36281 gets merged, the `TagSystem` methods will all give warnings. Let's fix those warnings before they even happen! * Adds missing libraries * Remove not yet implemented TagSystem changes * Fix tag spelling error Genuinely surprised there was only 1! * Styling and proper type changes * Styling Co-authored-by: Tayrtahn <tayrtahn@gmail.com> --------- Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
This commit is contained in:
@@ -7,6 +7,7 @@ using Content.Shared.Tag;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Prototypes;
|
||||
using System.Linq;
|
||||
|
||||
namespace Content.Shared.Implants;
|
||||
@@ -21,6 +22,9 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem
|
||||
|
||||
public const string BaseStorageId = "storagebase";
|
||||
|
||||
private static readonly ProtoId<TagPrototype> MicroBombTag = "MicroBomb";
|
||||
private static readonly ProtoId<TagPrototype> MacroBombTag = "MacroBomb";
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<SubdermalImplantComponent, EntGotInsertedIntoContainerMessage>(OnInsert);
|
||||
@@ -43,11 +47,11 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem
|
||||
}
|
||||
|
||||
//replace micro bomb with macro bomb
|
||||
if (_container.TryGetContainer(component.ImplantedEntity.Value, ImplanterComponent.ImplantSlotId, out var implantContainer) && _tag.HasTag(uid, "MacroBomb"))
|
||||
if (_container.TryGetContainer(component.ImplantedEntity.Value, ImplanterComponent.ImplantSlotId, out var implantContainer) && _tag.HasTag(uid, MacroBombTag))
|
||||
{
|
||||
foreach (var implant in implantContainer.ContainedEntities)
|
||||
{
|
||||
if (_tag.HasTag(implant, "MicroBomb"))
|
||||
if (_tag.HasTag(implant, MicroBombTag))
|
||||
{
|
||||
_container.Remove(implant, implantContainer);
|
||||
QueueDel(implant);
|
||||
|
||||
Reference in New Issue
Block a user