Fix deployable barrier light toggle (#4739)
This commit is contained in:
@@ -21,19 +21,11 @@ namespace Content.Client.Security
|
||||
{
|
||||
case DeployableBarrierState.Idle:
|
||||
sprite.LayerSetState(0, "idle");
|
||||
ToggleLight(component, false);
|
||||
break;
|
||||
case DeployableBarrierState.Deployed:
|
||||
sprite.LayerSetState(0, "deployed");
|
||||
ToggleLight(component, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleLight(AppearanceComponent component, bool enabled)
|
||||
{
|
||||
if (component.Owner.TryGetComponent(out PointLightComponent? light))
|
||||
light.Enabled = enabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,9 @@ namespace Content.Server.Security.Systems
|
||||
|
||||
var state = isDeployed ? DeployableBarrierState.Deployed : DeployableBarrierState.Idle;
|
||||
appearanceComponent.SetData(DeployableBarrierVisuals.State, state);
|
||||
|
||||
if (component.Owner.TryGetComponent(out PointLightComponent? light))
|
||||
light.Enabled = isDeployed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user