Pinpointers: Remove pinpointers from active list on shutdown of compo… (#5153)
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user