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.
This commit is contained in:
Víctor Aguilera Puerto
2019-03-23 22:42:41 +01:00
committed by Pieter-Jan Briers
parent dcd74e8305
commit 03856b79b4

View File

@@ -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;
}