From 7a0238015f6844081ba9c6530857981bd3d2803b Mon Sep 17 00:00:00 2001 From: Devyn Myers Date: Mon, 3 Jan 2022 16:15:25 -0500 Subject: [PATCH] Prevented magazine type from being applied when no magazines for said gun exist --- Scripts/MagazinePatcher.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Scripts/MagazinePatcher.cs b/Scripts/MagazinePatcher.cs index c02ad3b..a5c7635 100644 --- a/Scripts/MagazinePatcher.cs +++ b/Scripts/MagazinePatcher.cs @@ -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;