From: Zachary Higgs Date: Thu, 30 Jan 2025 19:14:53 +0000 (-0400) Subject: Fake Mindshield Implant cleans itself up on draw (#34718) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=abcd68273b1be39aa576813771d873a1294ac309;p=space-station-14.git Fake Mindshield Implant cleans itself up on draw (#34718) * Implant cleans itself up on draw - add an event to relay to an implant that it's being drawn, to tell it to clean itself up - Give Fake mindshield a cleanup method, to remove the component added fixing a problem where the icon persists after implant draw * Remove extra whitespace * CR Switch to using ContainerRemovedMessage --- diff --git a/Content.Shared/Mindshield/FakeMindShield/SharedFakeMindShieldImplantSystem.cs b/Content.Shared/Mindshield/FakeMindShield/SharedFakeMindShieldImplantSystem.cs index 8887025e3a..cb48ef6997 100644 --- a/Content.Shared/Mindshield/FakeMindShield/SharedFakeMindShieldImplantSystem.cs +++ b/Content.Shared/Mindshield/FakeMindShield/SharedFakeMindShieldImplantSystem.cs @@ -2,6 +2,7 @@ using Content.Shared.Implants; using Content.Shared.Implants.Components; using Content.Shared.Mindshield.Components; +using Robust.Shared.Containers; namespace Content.Shared.Mindshield.FakeMindShield; @@ -13,7 +14,9 @@ public sealed class SharedFakeMindShieldImplantSystem : EntitySystem base.Initialize(); SubscribeLocalEvent(OnFakeMindShieldToggle); SubscribeLocalEvent(ImplantCheck); + SubscribeLocalEvent(ImplantDraw); } + /// /// Raise the Action of a Implanted user toggling their implant to the FakeMindshieldComponent on their entity /// @@ -33,4 +36,9 @@ public sealed class SharedFakeMindShieldImplantSystem : EntitySystem if (ev.Implanted != null) EnsureComp(ev.Implanted.Value); } + + private void ImplantDraw(Entity ent, ref EntGotRemovedFromContainerMessage ev) + { + RemComp(ev.Container.Owner); + } }