Opening lockers or crates makes sound now.

This commit is contained in:
Pieter-Jan Briers
2019-07-27 09:23:00 +02:00
parent aea7d01eaa
commit 2e230c089b
5 changed files with 13 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
using System.Linq;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.Components.Sound;
using Content.Shared.GameObjects.Components.Storage;
using Robust.Server.GameObjects;
@@ -70,7 +71,12 @@ namespace Content.Server.GameObjects.Components
break;
}
}
ModifyComponents();
if (Owner.TryGetComponent(out SoundComponent soundComponent))
{
soundComponent.Play("/Audio/machines/closetclose.ogg");
}
}
private void OpenStorage()
@@ -78,10 +84,14 @@ namespace Content.Server.GameObjects.Components
Open = true;
EmptyContents();
ModifyComponents();
if (Owner.TryGetComponent(out SoundComponent soundComponent))
{
soundComponent.Play("/Audio/machines/closetopen.ogg");
}
}
private void ModifyComponents()
{
{
if (Owner.TryGetComponent<ICollidableComponent>(out var collidableComponent))
{
collidableComponent.CollisionEnabled = IsCollidableWhenOpen || !Open;