From 74ca0b1c49be1424ee3d0b4f327cbbd4e08aaff6 Mon Sep 17 00:00:00 2001 From: Hauke Lasinger Date: Wed, 12 Jan 2022 12:24:47 +0100 Subject: [PATCH] Fixes pawn getting stuck when sleeping on the ground --- Source/ZLevels/ZLevels/HarmonyPatches/JobPatches.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/ZLevels/ZLevels/HarmonyPatches/JobPatches.cs b/Source/ZLevels/ZLevels/HarmonyPatches/JobPatches.cs index efd54f5..250fd9e 100644 --- a/Source/ZLevels/ZLevels/HarmonyPatches/JobPatches.cs +++ b/Source/ZLevels/ZLevels/HarmonyPatches/JobPatches.cs @@ -839,6 +839,9 @@ private static Job TryGiveJob(Pawn pawn, RestCategory minCategory, float maxLeve private static IntVec3 FindGroundSleepSpotFor(Pawn pawn) { Map map = pawn.Map; + ZUtils.currentLookedIntoMap = map; + //ZUtils.ZTracker.jobTracker.TryGetValue( pawn, out var jobTracker ); + //var localCellMap = jobTracker?.lookedAtLocalCellMap; for (int i = 0; i < 2; i++) { int radius = (i == 0) ? 4 : 12;