Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions EXILED/Exiled.Events/Handlers/Internal/Round.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ namespace Exiled.Events.Handlers.Internal
using Exiled.Events.EventArgs.Scp049;
using Exiled.Loader;
using Exiled.Loader.Features;
using global::Scp914.Processors;
using InventorySystem;
using InventorySystem.Items;
using InventorySystem.Items.Firearms.Attachments;
using InventorySystem.Items.Firearms.Attachments.Components;
using InventorySystem.Items.Usables;
Expand All @@ -48,6 +50,7 @@ internal static class Round
public static void OnWaitingForPlayers()
{
GenerateAttachments();
AddMissingScp914Processors();
MultiAdminFeatures.CallEvent(MultiAdminFeatures.EventType.WAITING_FOR_PLAYERS);

if (Events.Instance.Config.ShouldReloadConfigsAtRoundRestart)
Expand Down Expand Up @@ -171,5 +174,30 @@ private static void GenerateAttachments()
HashSetPool<AttachmentSlot>.Pool.Return(attachmentsSlots);
}
}

private static void AddMissingScp914Processors()
{
foreach (KeyValuePair<ItemType, ItemBase> entry in InventoryItemLoader.AvailableItems)
{
ItemType itemType = entry.Key;
ItemBase item = entry.Value;

if (item is null || item.TryGetComponent<Scp914ItemProcessor>(out _))
{
continue;
}

ItemType[] outputs = new[] { itemType };

StandardItemProcessor processor = item.gameObject.AddComponent<StandardItemProcessor>();

processor._roughOutputs = outputs;
processor._coarseOutputs = outputs;
processor._oneToOneOutputs = outputs;
processor._fineOutputs = outputs;
processor._veryFineOutputs = outputs;
processor._fireUpgradeTrigger = false;
}
}
}
}
Loading