Only play tool sound if the use goes through

This commit is contained in:
zumorica
2020-05-22 21:24:59 +02:00
parent d2d6c2cecd
commit 6daa1bcf27

View File

@@ -115,9 +115,12 @@ namespace Content.Server.GameObjects.Components.Interactable
public virtual bool UseTool(IEntity user, IEntity target, ToolQuality toolQualityNeeded) public virtual bool UseTool(IEntity user, IEntity target, ToolQuality toolQualityNeeded)
{ {
if (!HasQuality(toolQualityNeeded) || !ActionBlockerSystem.CanInteract(user))
return false;
PlayUseSound(); PlayUseSound();
return ActionBlockerSystem.CanInteract(user) && HasQuality(toolQualityNeeded); return true;
} }
protected void PlaySoundCollection(string name, float volume=-5f) protected void PlaySoundCollection(string name, float volume=-5f)