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();
|
base.Initialize();
|
||||||
SubscribeLocalEvent<PinpointerComponent, ComponentGetState>(GetCompState);
|
SubscribeLocalEvent<PinpointerComponent, ComponentGetState>(GetCompState);
|
||||||
|
SubscribeLocalEvent<PinpointerComponent, ComponentShutdown>(OnPinpointerShutdown);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GetCompState(EntityUid uid, PinpointerComponent pinpointer, ref ComponentGetState args)
|
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>
|
/// <summary>
|
||||||
/// Manually set distance from pinpointer to target
|
/// Manually set distance from pinpointer to target
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user