Skip to content

Commit

Permalink
Prevented magazine type from being applied when no magazines for said…
Browse files Browse the repository at this point in the history
… gun exist
  • Loading branch information
devyndamonster committed Jan 3, 2022
1 parent d6de84a commit 7a02380
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Scripts/MagazinePatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,12 @@ private static void ApplyMagazineCache(CompatibleMagazineCache magazineCache)
{
FVRObject firearm = IM.OD[entry.FirearmID];

firearm.MagazineType = entry.MagType;
//Note, only apply magazine type if magazines exist for gun, because of some assumptions made by game code
if (IM.CompatMags.ContainsKey(entry.MagType))
{
firearm.MagazineType = entry.MagType;
}

firearm.RoundType = entry.BulletType;
firearm.ClipType = entry.ClipType;

Expand Down

0 comments on commit 7a02380

Please sign in to comment.