Skip to content

Commit e4f23d9

Browse files
committed
Minor optimisation to #3
1 parent b6775e2 commit e4f23d9

File tree

6 files changed

+1
-2
lines changed

6 files changed

+1
-2
lines changed

1.1/Assemblies/TinyTweaks.dll

0 Bytes
Binary file not shown.
6 KB
Binary file not shown.
0 Bytes
Binary file not shown.

Source/TinyTweaks/HarmonyPatches/Patch_SkillRecord.cs

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

2222
public static bool Prefix(SkillRecord __instance, Pawn ___pawn)
2323
{
24-
CompSkillRecordCache cache = ___pawn.GetComp<CompSkillRecordCache>();
2524
// Delay skill decay
26-
if (TinyTweaksSettings.delayedSkillDecay && cache != null && !cache.CanDecaySkill(__instance.def))
25+
if (TinyTweaksSettings.delayedSkillDecay && ___pawn.GetComp<CompSkillRecordCache>() is CompSkillRecordCache cache && !cache.CanDecaySkill(__instance.def))
2726
return false;
2827
return true;
2928
}
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)