Cleanup matches on shutdown (#5724)
This commit is contained in:
@@ -24,6 +24,12 @@ namespace Content.Server.Light.EntitySystems
|
|||||||
base.Initialize();
|
base.Initialize();
|
||||||
SubscribeLocalEvent<MatchstickComponent, InteractUsingEvent>(OnInteractUsing);
|
SubscribeLocalEvent<MatchstickComponent, InteractUsingEvent>(OnInteractUsing);
|
||||||
SubscribeLocalEvent<MatchstickComponent, IsHotEvent>(OnIsHotEvent);
|
SubscribeLocalEvent<MatchstickComponent, IsHotEvent>(OnIsHotEvent);
|
||||||
|
SubscribeLocalEvent<MatchstickComponent, ComponentShutdown>(OnShutdown);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnShutdown(EntityUid uid, MatchstickComponent component, ComponentShutdown args)
|
||||||
|
{
|
||||||
|
_litMatches.Remove(component);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update(float frameTime)
|
public override void Update(float frameTime)
|
||||||
@@ -31,7 +37,7 @@ namespace Content.Server.Light.EntitySystems
|
|||||||
base.Update(frameTime);
|
base.Update(frameTime);
|
||||||
foreach (var match in _litMatches)
|
foreach (var match in _litMatches)
|
||||||
{
|
{
|
||||||
if (match.CurrentState != SmokableState.Lit)
|
if (match.CurrentState != SmokableState.Lit || match.Paused || match.Deleted)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
_atmosphereSystem.HotspotExpose(EntityManager.GetComponent<TransformComponent>(match.Owner).Coordinates, 400, 50, true);
|
_atmosphereSystem.HotspotExpose(EntityManager.GetComponent<TransformComponent>(match.Owner).Coordinates, 400, 50, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user