From af8aba34e73e2a215f9e31e26dfa79039588c9f8 Mon Sep 17 00:00:00 2001 From: Spagles <106791090+Spagles@users.noreply.github.com> Date: Fri, 31 Jul 2026 23:23:40 +1000 Subject: [PATCH 1/3] Reset primitive verb cache fields using integer values instead of null --- Source/ThingComps/CompDynamicTraits.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 98f3e373f69bb38122bde400ee2779d393c65b68 Mon Sep 17 00:00:00 2001 From: Spagles <106791090+Spagles@users.noreply.github.com> Date: Fri, 31 Jul 2026 23:24:11 +1000 Subject: [PATCH 2/3] Ensure extraDamages list is initialized on projectile launch --- Source/HarmonyPatches/Postfix_Projectile_Launch.cs | 1 + 1 file changed, 1 insertion(+) 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); } From 301824802d5fdb6696e46f0d88108ee30caddb50 Mon Sep 17 00:00:00 2001 From: Spagles <106791090+Spagles@users.noreply.github.com> Date: Fri, 31 Jul 2026 23:24:49 +1000 Subject: [PATCH 3/3] Safely navigate null selected pawn in reload float menu options --- .../Postfix_FloatMenuOptionProvider_Reload_GetOptionsFor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }