From 03856b79b4df00d43e3435b9eb1fce91abb0c62b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Aguilera=20Puerto?= <6766154+Zumorica@users.noreply.github.com> Date: Sat, 23 Mar 2019 22:42:41 +0100 Subject: [PATCH] Fix the sound bug when clicking on lights. (#155) It was updating lights when there was nothing to be updated, which caused the sound to play. --- .../Components/Power/PoweredLightComponent.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Content.Server/GameObjects/Components/Power/PoweredLightComponent.cs b/Content.Server/GameObjects/Components/Power/PoweredLightComponent.cs index b053aff790..555ab4ea2b 100644 --- a/Content.Server/GameObjects/Components/Power/PoweredLightComponent.cs +++ b/Content.Server/GameObjects/Components/Power/PoweredLightComponent.cs @@ -62,13 +62,10 @@ namespace Content.Server.GameObjects.Components.Power UpdateLight(); return true; } - else - { - if (!user.TryGetComponent(out DamageableComponent damageableComponent)) return false; - damageableComponent.TakeDamage(DamageType.Heat, 20); - } - UpdateLight(); + if (!user.TryGetComponent(out DamageableComponent damageableComponent)) return false; + damageableComponent.TakeDamage(DamageType.Heat, 20); + return true; return false; }