diff --git a/Source/Vampires/HarmonyPatches/HarmonyPatches_Pathing.cs b/Source/Vampires/HarmonyPatches/HarmonyPatches_Pathing.cs index 5b6ba86..8f24d6e 100644 --- a/Source/Vampires/HarmonyPatches/HarmonyPatches_Pathing.cs +++ b/Source/Vampires/HarmonyPatches/HarmonyPatches_Pathing.cs @@ -55,14 +55,14 @@ public static void HarmonyPatches_Pathing(Harmony harmony) // Verse.ReachabilityUtility public static void CanReach_Vampire(ref bool __result, Pawn pawn, LocalTargetInfo dest, PathEndMode peMode, Danger maxDanger, bool canBashDoors = false, bool canBashFences = false, TraverseMode mode = TraverseMode.ByPawn) { + if !(__result && pawn.IsVampire()) return; var inBeastMentalState = pawn?.MentalStateDef == DefDatabase.GetNamed("ROMV_VampireBeast"); var inRestrictedSunlightAIMode = pawn?.VampComp()?.CurrentSunlightPolicy == SunlightPolicy.Restricted; var isDaylight = VampireUtility.IsDaylight(pawn); var isPlayerCharacter = pawn?.Faction == Faction.OfPlayerSilentFail; var isNotDrafted = !pawn?.Drafted ?? false; var destIsNotRoofed = !dest.Cell.Roofed(pawn?.MapHeld ?? Find.CurrentMap); - if (__result && pawn.IsVampire() && - (inRestrictedSunlightAIMode || inBeastMentalState) && + if ((inRestrictedSunlightAIMode || inBeastMentalState) && isDaylight && isPlayerCharacter && isNotDrafted && destIsNotRoofed) __result = false; }