From 5010e8606e18a1bd519e62feff587ce1b522337a Mon Sep 17 00:00:00 2001 From: Raymond Johnson Date: Thu, 21 Apr 2022 09:50:40 -0500 Subject: [PATCH] maybe --- API/Modifiers/FirearmModifier.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/API/Modifiers/FirearmModifier.cs b/API/Modifiers/FirearmModifier.cs index 8c9e523..f368963 100644 --- a/API/Modifiers/FirearmModifier.cs +++ b/API/Modifiers/FirearmModifier.cs @@ -77,7 +77,7 @@ private void ModifyAttachments(FirearmBase gun) { //this should affect a random attachment on the gun, but since it is reset each att change it doesn't matter which one it affects if (ModifiedAttachments.TryGetValue(AttachmentName.None, out Dictionary defaultParams)) - ModifyParameters(gun, gun.Attachments.FirstOrDefault(), defaultParams); + ModifyParameters(gun, gun.Attachments.FirstOrDefault((att) => att != null && att.IsEnabled), defaultParams); foreach (Attachment att in gun.Attachments.Where((att) => att.IsEnabled && att.Name != AttachmentName.None)) {