- fix: Mindshield implant removal fix. (#154)

This commit is contained in:
Aviu00
2024-03-01 17:36:17 +09:00
committed by GitHub
parent f5dc598ee1
commit 9b5dd4481d

View File

@@ -3,6 +3,7 @@ using Content.Shared.Actions;
using Content.Shared.Implants.Components;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.Mindshield.Components;
using Content.Shared.Mobs;
using Content.Shared.Tag;
using JetBrains.Annotations;
@@ -72,6 +73,16 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem
if (component.ImplantAction != null)
_actionsSystem.RemoveProvidedActions(component.ImplantedEntity.Value, uid);
// WD EDIT START
if (_tag.HasTag(uid, "MindShield") &&
_container.TryGetContainer(component.ImplantedEntity.Value, ImplanterComponent.ImplantSlotId,
out var implantContainer) &&
implantContainer.ContainedEntities.All(x => !_tag.HasTag(x, "MindShield")))
{
RemCompDeferred<MindShieldComponent>(component.ImplantedEntity.Value);
}
// WD EDIT END
if (!_container.TryGetContainer(uid, BaseStorageId, out var storageImplant))
return;