diff --git a/Source/HarmonyPatches/Postfix_FloatMenuOptionProvider_Reload_GetOptionsFor.cs b/Source/HarmonyPatches/Postfix_FloatMenuOptionProvider_Reload_GetOptionsFor.cs index 5149a3a..9da38f9 100644 --- a/Source/HarmonyPatches/Postfix_FloatMenuOptionProvider_Reload_GetOptionsFor.cs +++ b/Source/HarmonyPatches/Postfix_FloatMenuOptionProvider_Reload_GetOptionsFor.cs @@ -16,7 +16,7 @@ public static IEnumerable Postfix(IEnumerable } var pawn = context.FirstSelectedPawn; - var abilityProvider = pawn.equipment?.Primary?.TryGetComp(); + var abilityProvider = pawn?.equipment?.Primary?.TryGetComp(); if (abilityProvider == null) { yield break; } diff --git a/Source/HarmonyPatches/Postfix_Projectile_Launch.cs b/Source/HarmonyPatches/Postfix_Projectile_Launch.cs index 92b0162..ca65dc1 100644 --- a/Source/HarmonyPatches/Postfix_Projectile_Launch.cs +++ b/Source/HarmonyPatches/Postfix_Projectile_Launch.cs @@ -24,6 +24,7 @@ public static void Postfix(Projectile __instance, Thing? equipment) { } if (!trait.extraDamages.NullOrEmpty()) { + __instance.extraDamages ??= []; __instance.extraDamages.AddRange(trait.extraDamages); } diff --git a/Source/ThingComps/CompDynamicTraits.cs b/Source/ThingComps/CompDynamicTraits.cs index 602b739..1f9d2d9 100644 --- a/Source/ThingComps/CompDynamicTraits.cs +++ b/Source/ThingComps/CompDynamicTraits.cs @@ -400,8 +400,8 @@ private void ClearAllCaches() { if (verb == null) return; // === cached === - AccessTools.Field(typeof(Verb), "cachedBurstShotCount").SetValue(verb, null); - AccessTools.Field(typeof(Verb), "cachedTicksBetweenBurstShots").SetValue(verb, null); + AccessTools.Field(typeof(Verb), "cachedBurstShotCount").SetValue(verb, -1); + AccessTools.Field(typeof(Verb), "cachedTicksBetweenBurstShots").SetValue(verb, -1); } #endregion