From 52ae0823f615dae26e7c261f8788dfd7bfbf6352 Mon Sep 17 00:00:00 2001 From: user Date: Sun, 1 Dec 2024 02:12:11 +0300 Subject: [PATCH] Unfog Landed Ship (Charlon Whitestone) as it won't unfog completely with all rooms visited, leaving fogged parts because of multiple layers of ship hull and/or impassable buildings. --- Source/1.5/HarmonyPatches.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/1.5/HarmonyPatches.cs b/Source/1.5/HarmonyPatches.cs index b5534fad..53803540 100644 --- a/Source/1.5/HarmonyPatches.cs +++ b/Source/1.5/HarmonyPatches.cs @@ -3160,7 +3160,7 @@ public static void Postfix(ref IEnumerable __result, Pawn pawn) } [HarmonyPatch(typeof(GenStep_Fog), "Generate")] - public static class UnfogVault + public static class UnfogVaultAndLandedShip { public static void Postfix(Map map) { @@ -3168,6 +3168,17 @@ public static void Postfix(Map map) { FloodFillerFog.FloodUnfog(casket.Position, map); } + ShipMapComp mapComp = map.GetComponent(); + foreach (SpaceShipCache ship in mapComp.ShipsOnMap.Values.Where(s => !s.IsWreck)) + { + if (ship.Name == "Charlon Whitestone") + { + foreach (IntVec3 tile in ship.Area) + { + map.fogGrid.Unfog(tile); + } + } + } } }