This commit is contained in:
2026-02-24 12:02:38 +08:00
parent 1af5f0c1d8
commit 96bc1d4c5a
57 changed files with 6595 additions and 1170 deletions

View File

@@ -0,0 +1,28 @@
// File: HarmonyPatches/SkillSystemPatches.cs
using HarmonyLib;
using RimWorld;
using Verse;
namespace WulaFallenEmpire
{
/// <summary>
/// 针对SkillRecord.Interval()的补丁,防止在机甲上出现空引用
/// </summary>
[HarmonyPatch(typeof(SkillRecord))]
[HarmonyPatch("Interval")]
public static class Patch_SkillRecord_Interval
{
[HarmonyPrefix]
public static bool Prefix(SkillRecord __instance)
{
// 额外检查如果pawn.story为null也跳过
if (__instance?.Pawn?.story == null)
{
return false; // 跳过原方法
}
return true; // 执行原方法
}
}
}