Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
OutsiderH committed Sep 9, 2023
1 parent 91d63a1 commit 9695fd4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions RoundPreset/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace OutsiderH.RoundPreset
using static Plugin;
using AddItemEventArgs = GEventArgs2;
using BaseItemEventArgs = GEventArgs1;
using InGameStatus = GClass1819;
using ItemJobResult = GStruct370;
using ItemManager = GClass2672;
using MagazinePtr = GClass2666;
Expand Down Expand Up @@ -156,10 +157,12 @@ internal sealed class CustomInteractionsProvider : IItemCustomInteractionsProvid
internal static StaticIcons StaticIcons => EFTHardSettings.Instance.StaticIcons;
public IEnumerable<CustomInteraction> GetCustomInteractions(ItemUiContext uiContext, EItemViewType viewType, Item item)
{
if (viewType != EItemViewType.Inventory)
# pragma warning disable CS0618
if (viewType != EItemViewType.Inventory || InGameStatus.InRaid)
{
yield break;
}
# pragma warning restore CS0618
if (item is not MagazineClass mag)
{
yield break;
Expand Down Expand Up @@ -390,7 +393,7 @@ internal static JsonItem.Root ToJsonObject(this Dictionary<MagazineKey, IList<IR
{
AllPresets = new()
};
foreach(var uniqueMagPresets in presets)
foreach (var uniqueMagPresets in presets)
{
JsonItem.PresetsItem presetsJson = new()
{
Expand All @@ -402,7 +405,7 @@ internal static JsonItem.Root ToJsonObject(this Dictionary<MagazineKey, IList<IR
{
Chunks = new()
};
foreach(var chunk in preset)
foreach (var chunk in preset)
{
presetJson.Chunks.Add(new(chunk.id, chunk.count, chunk.sName));
}
Expand All @@ -418,10 +421,10 @@ internal static Dictionary<MagazineKey, IList<IReadOnlyList<PresetAmmo>>> ToOrig
foreach (var uniqueMagPresetItem in jsonObject.AllPresets)
{
List<IReadOnlyList<PresetAmmo>> presets = new();
foreach(var presetItem in uniqueMagPresetItem.Value.Presets)
foreach (var presetItem in uniqueMagPresetItem.Value.Presets)
{
List<PresetAmmo> preset = new();
foreach(var chunkItem in presetItem.Chunks)
foreach (var chunkItem in presetItem.Chunks)
{
preset.Add(new(chunkItem.Id, chunkItem.Count, chunkItem.Name));
}
Expand Down

0 comments on commit 9695fd4

Please sign in to comment.