23 lines
582 B
C#
23 lines
582 B
C#
using HarmonyLib;
|
|
using Verse;
|
|
using RimWorld;
|
|
|
|
namespace ArachnaeSwarm
|
|
{
|
|
[HarmonyPatch(typeof(Building_TurretGun), "get_CanSetForcedTarget")]
|
|
public static class Patch_Building_TurretGun_CanSetForcedTarget
|
|
{
|
|
public static void Postfix(Building_TurretGun __instance, ref bool __result)
|
|
{
|
|
if (__result)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (__instance.GetComp<CompForceTargetable>() != null && __instance.Faction == Faction.OfPlayer)
|
|
{
|
|
__result = true;
|
|
}
|
|
}
|
|
}
|
|
} |