Pinpointers: Remove pinpointers from active list on shutdown of compo… (#5153)

This commit is contained in:
20kdc
2021-11-03 23:42:22 +00:00
committed by GitHub
parent 151d62b792
commit 956afbf1f1

View File

@@ -13,6 +13,7 @@ namespace Content.Shared.Pinpointer
{
base.Initialize();
SubscribeLocalEvent<PinpointerComponent, ComponentGetState>(GetCompState);
SubscribeLocalEvent<PinpointerComponent, ComponentShutdown>(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);
}
/// <summary>
/// Manually set distance from pinpointer to target
/// </summary>