Storage system opts (#7427)
This commit is contained in:
@@ -366,6 +366,7 @@ namespace Content.Server.Storage.Components
|
||||
SubscribedSessions.Add(session);
|
||||
}
|
||||
|
||||
_entityManager.EnsureComponent<ActiveStorageComponent>(Owner);
|
||||
if (SubscribedSessions.Count == 1)
|
||||
UpdateStorageVisualization();
|
||||
}
|
||||
@@ -388,7 +389,14 @@ namespace Content.Server.Storage.Components
|
||||
CloseNestedInterfaces(session);
|
||||
|
||||
if (SubscribedSessions.Count == 0)
|
||||
{
|
||||
UpdateStorageVisualization();
|
||||
|
||||
if (_entityManager.HasComponent<ActiveStorageComponent>(Owner))
|
||||
{
|
||||
_entityManager.RemoveComponent<ActiveStorageComponent>(Owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -635,4 +643,7 @@ namespace Content.Server.Storage.Components
|
||||
SoundSystem.Play(Filter.Pvs(Owner), StorageSoundCollection.GetSound(), Owner, AudioParams.Default);
|
||||
}
|
||||
}
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class ActiveStorageComponent : Component {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user