?
This commit is contained in:
Binary file not shown.
@@ -10,15 +10,12 @@ namespace WulaFallenEmpire
|
|||||||
[HarmonyPatch(typeof(Pawn), "ThreatDisabled")]
|
[HarmonyPatch(typeof(Pawn), "ThreatDisabled")]
|
||||||
public static class Patch_Pawn_ThreatDisabled
|
public static class Patch_Pawn_ThreatDisabled
|
||||||
{
|
{
|
||||||
public static void Postfix(Pawn __instance, IAttackTargetSearcher disabledFor, ref bool __result)
|
public static void Postfix(Pawn __instance, ref bool __result)
|
||||||
{
|
{
|
||||||
if (!__result) return;
|
// 如果已经判定为无威胁,检查是否有CompAutonomousMech组件
|
||||||
if (!__instance.IsColonyMech) return;
|
if (__result && __instance.GetComp<CompAutonomousMech>() != null)
|
||||||
|
|
||||||
var comp = __instance.GetComp<CompAutonomousMech>();
|
|
||||||
if (comp != null && comp.CanFightAutonomously)
|
|
||||||
{
|
{
|
||||||
__result = false;
|
__result = false; // 强制设置为有威胁
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user