Opening lockers or crates makes sound now.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user