Fix firevisuals layer spam (#14871)
This commit is contained in:
@@ -27,8 +27,13 @@ public sealed class FireVisualizerSystem : VisualizerSystem<FireVisualsComponent
|
|||||||
component.LightEntity = null;
|
component.LightEntity = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TryComp<SpriteComponent>(uid, out var sprite))
|
// Need LayerMapTryGet because Init fails if there's no existing sprite / appearancecomp
|
||||||
sprite.RemoveLayer(FireVisualLayers.Fire);
|
// which means in some setups (most frequently no AppearanceComp) the layer never exists.
|
||||||
|
if (TryComp<SpriteComponent>(uid, out var sprite) &&
|
||||||
|
sprite.LayerMapTryGet(FireVisualLayers.Fire, out var layer))
|
||||||
|
{
|
||||||
|
sprite.RemoveLayer(layer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnComponentInit(EntityUid uid, FireVisualsComponent component, ComponentInit args)
|
private void OnComponentInit(EntityUid uid, FireVisualsComponent component, ComponentInit args)
|
||||||
|
|||||||
Reference in New Issue
Block a user