From 85de1b2fd7d869ccb8650b196881da969f68e4fa Mon Sep 17 00:00:00 2001 From: pheenty Date: Wed, 23 Oct 2024 03:45:45 +0700 Subject: [PATCH] less variables --- Content.Shared/Stories/Nightvision/NightvisionComponent.cs | 4 +--- Content.Shared/Stories/Nightvision/SharedNightvisionSystem.cs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Content.Shared/Stories/Nightvision/NightvisionComponent.cs b/Content.Shared/Stories/Nightvision/NightvisionComponent.cs index a323e2e7ab..f8ae264f85 100644 --- a/Content.Shared/Stories/Nightvision/NightvisionComponent.cs +++ b/Content.Shared/Stories/Nightvision/NightvisionComponent.cs @@ -15,10 +15,8 @@ public sealed partial class NightvisionComponent : Component public string ToggleAction = "ToggleNightvisionAction"; [DataField, AutoNetworkedField] public EntityUid? ToggleActionEntity; - [ViewVariables(VVAccess.ReadWrite), DataField("playSound"), AutoNetworkedField] - public bool PlaySound { get; set; } = true; // For dragon [DataField("toggleOnSound")] - public SoundSpecifier ToggleOnSound = new SoundPathSpecifier("/Audio/Stories/Misc/night_vision.ogg"); + public SoundSpecifier? ToggleOnSound = new SoundPathSpecifier("/Audio/Stories/Misc/night_vision.ogg"); } [RegisterComponent] diff --git a/Content.Shared/Stories/Nightvision/SharedNightvisionSystem.cs b/Content.Shared/Stories/Nightvision/SharedNightvisionSystem.cs index 1db31d3317..1b78c112ef 100644 --- a/Content.Shared/Stories/Nightvision/SharedNightvisionSystem.cs +++ b/Content.Shared/Stories/Nightvision/SharedNightvisionSystem.cs @@ -16,7 +16,7 @@ private void OnToggle(EntityUid uid, NightvisionComponent component, ToggleNight if (!_timing.IsFirstTimePredicted) return; component.Enabled = !component.Enabled; - if (component.Enabled && component.PlaySound) + if (component.Enabled && component.ToggleOnSound != null) _audio.PlayLocal(component.ToggleOnSound, uid, uid); } }