From 956afbf1f125cdcda09c35215a5ac41485eac46e Mon Sep 17 00:00:00 2001 From: 20kdc Date: Wed, 3 Nov 2021 23:42:22 +0000 Subject: [PATCH] =?UTF-8?q?Pinpointers:=20Remove=20pinpointers=20from=20ac?= =?UTF-8?q?tive=20list=20on=20shutdown=20of=20compo=E2=80=A6=20(#5153)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Shared/Pinpointer/SharedPinpointerSystem.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Content.Shared/Pinpointer/SharedPinpointerSystem.cs b/Content.Shared/Pinpointer/SharedPinpointerSystem.cs index ea553098ef..b144b738ad 100644 --- a/Content.Shared/Pinpointer/SharedPinpointerSystem.cs +++ b/Content.Shared/Pinpointer/SharedPinpointerSystem.cs @@ -13,6 +13,7 @@ namespace Content.Shared.Pinpointer { base.Initialize(); SubscribeLocalEvent(GetCompState); + SubscribeLocalEvent(OnPinpointerShutdown); } private void GetCompState(EntityUid uid, PinpointerComponent pinpointer, ref ComponentGetState args) @@ -25,6 +26,12 @@ namespace Content.Shared.Pinpointer }; } + private void OnPinpointerShutdown(EntityUid uid, PinpointerComponent component, ComponentShutdown _) + { + // no need to dirty it/etc: it's shutting down anyway! + ActivePinpointers.Remove(uid); + } + /// /// Manually set distance from pinpointer to target ///