Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jecrell committed Jun 24, 2022
2 parents fc2ed0b + d09b02a commit d6cd845
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Vampires/HarmonyPatches/HarmonyPatches_Pathing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<MentalStateDef>.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;
}

Expand Down

0 comments on commit d6cd845

Please sign in to comment.