Skip to content

Commit b6775e2

Browse files
authored
Merge pull request #3 from BryanAldrich/master
Adds a null check for skill decay for pawns w/o skills
2 parents 6ed95c4 + 1011716 commit b6775e2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Source/TinyTweaks/HarmonyPatches/Patch_SkillRecord.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ public static class Interval
2121

2222
public static bool Prefix(SkillRecord __instance, Pawn ___pawn)
2323
{
24+
CompSkillRecordCache cache = ___pawn.GetComp<CompSkillRecordCache>();
2425
// Delay skill decay
25-
if (TinyTweaksSettings.delayedSkillDecay && !___pawn.GetComp<CompSkillRecordCache>().CanDecaySkill(__instance.def))
26+
if (TinyTweaksSettings.delayedSkillDecay && cache != null && !cache.CanDecaySkill(__instance.def))
2627
return false;
2728
return true;
2829
}

0 commit comments

Comments
 (0)