Skip to content

Commit

Permalink
Silence, reagent dispenser (#2862)
Browse files Browse the repository at this point in the history
  • Loading branch information
whatston3 authored Feb 5, 2025
1 parent fd99f4c commit 87be818
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public sealed class ReagentDispenserSystem : EntitySystem
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly OpenableSystem _openable = default!;
[Dependency] private readonly LabelSystem _label = default!; // Frontier
[Dependency] private readonly SharedContainerSystem _containers = default!; // Frontier

public override void Initialize()
{
Expand Down Expand Up @@ -279,8 +280,10 @@ private void OnMapInit(EntityUid uid, ReagentDispenserComponent component, MapIn
{
for (var i = 0; i < packPrototype.Inventory.Count && i < component.StorageSlots.Count; i++)
{
if (component.StorageSlots[i].ContainerSlot == null)
continue;
var item = Spawn(packPrototype.Inventory[i], Transform(uid).Coordinates);
if (!_itemSlotsSystem.TryInsert(uid, component.StorageSlots[i].ID!, item, null, excludeUserAudio: true))
if (!_containers.Insert(item, component.StorageSlots[i].ContainerSlot!)) // ContainerSystem.Insert is silent.
QueueDel(item);
}
}
Expand Down

0 comments on commit 87be818

Please sign in to comment.