Visualizer systems update (#8203)
* optimize appearance updating for subfloor entities * sprite event args * a * stop double appearance update.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Content.Client.Tools.Components;
|
||||
using Content.Client.Tools.Components;
|
||||
using Content.Shared.Tools.Components;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
@@ -8,14 +8,12 @@ public sealed class WelderVisualizerSystem : VisualizerSystem<WelderComponent>
|
||||
{
|
||||
protected override void OnAppearanceChange(EntityUid uid, WelderComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
base.OnAppearanceChange(uid, component, ref args);
|
||||
|
||||
if (!TryComp(uid, out SpriteComponent? sprite))
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
if (args.Component.TryGetData(WelderVisuals.Lit, out bool isLit))
|
||||
{
|
||||
sprite.LayerSetVisible(WelderLayers.Flame, isLit);
|
||||
args.Sprite.LayerSetVisible(WelderLayers.Flame, isLit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user