diff --git a/About/About.xml b/About/About.xml
new file mode 100644
index 0000000..1bc15cf
--- /dev/null
+++ b/About/About.xml
@@ -0,0 +1,9 @@
+
+
+
+ Collapser
+ Jaxe
+ 0.19.0
+ Collapser is a simple mod that alters how a thick overhead mountain roof will collapse.\n\nIf an overhead mountain roof collapses and there is a non-thick roof on a tile directly adjacent to the north, south, east or west of it then the thick roof will be removed.\nThis does not particularly make it easy to carve out open areas inside mountains but the main purpose of this mod is to deal with randomly isolated overhead mountain tiles.
+ https://ludeon.com/forums/index.php?topic=43486.0
+
diff --git a/About/ModSync.xml b/About/ModSync.xml
new file mode 100644
index 0000000..9745dae
--- /dev/null
+++ b/About/ModSync.xml
@@ -0,0 +1,15 @@
+
+
+
+ 59f538ed-f86d-4506-a4a5-7e9faaa37509
+ Collapser
+ v1.0
+ False
+
+ Jaxe-Dev
+ Collapser
+ About
+ ModSyncReleases
+ master
+
+
diff --git a/Assemblies/0Harmony.dll b/Assemblies/0Harmony.dll
new file mode 100644
index 0000000..6c0dd94
Binary files /dev/null and b/Assemblies/0Harmony.dll differ
diff --git a/Assemblies/Collapser.dll b/Assemblies/Collapser.dll
new file mode 100644
index 0000000..b16e55b
Binary files /dev/null and b/Assemblies/Collapser.dll differ
diff --git a/Source/Collapser.csproj b/Source/Collapser.csproj
new file mode 100644
index 0000000..d6cf278
--- /dev/null
+++ b/Source/Collapser.csproj
@@ -0,0 +1,54 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {D3159CFD-253F-4FA0-8846-1B44B1C6949B}
+ Library
+ Properties
+ Collapser
+ Collapser
+ v3.5
+ 512
+
+
+
+ false
+ none
+ false
+ ..\Assemblies\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ none
+ true
+ ..\Assemblies\
+ TRACE
+ prompt
+ 4
+
+
+
+ False
+ ..\Assemblies\0Harmony.dll
+
+
+ ..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll
+ False
+
+
+
+ ..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll
+ False
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Source/Collapser.sln b/Source/Collapser.sln
new file mode 100644
index 0000000..dd15d8e
--- /dev/null
+++ b/Source/Collapser.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26228.9
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Collapser", "Collapser.csproj", "{D3159CFD-253F-4FA0-8846-1B44B1C6949B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {D3159CFD-253F-4FA0-8846-1B44B1C6949B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D3159CFD-253F-4FA0-8846-1B44B1C6949B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D3159CFD-253F-4FA0-8846-1B44B1C6949B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D3159CFD-253F-4FA0-8846-1B44B1C6949B}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Source/Main.cs b/Source/Main.cs
new file mode 100644
index 0000000..a76123d
--- /dev/null
+++ b/Source/Main.cs
@@ -0,0 +1,11 @@
+using Harmony;
+using Verse;
+
+namespace Collapser
+{
+ [StaticConstructorOnStartup]
+ internal static class Main
+ {
+ static Main() => HarmonyInstance.Create("Collapser").PatchAll();
+ }
+}
diff --git a/Source/Patch.cs b/Source/Patch.cs
new file mode 100644
index 0000000..a731f49
--- /dev/null
+++ b/Source/Patch.cs
@@ -0,0 +1,53 @@
+using System;
+using System.Linq;
+using Harmony;
+using RimWorld;
+using Verse;
+
+namespace Collapser
+{
+ [HarmonyPatch(typeof(RoofCollapserImmediate), "DropRoofInCellPhaseTwo")]
+ internal static class Patch
+ {
+ private static void Prefix(IntVec3 c, Map map)
+ {
+ var roofDef = map.roofGrid.RoofAt(c);
+ if (roofDef == null) { return; }
+ if (roofDef.filthLeaving != null) { FilthMaker.MakeFilth(c, map, roofDef.filthLeaving); }
+ if (roofDef.VanishOnCollapse) { map.roofGrid.SetRoof(c, null); }
+ else if (AdjacentUnroofedTiles(c, map) > 0) { map.roofGrid.SetRoof(c, null); }
+ var bound = CellRect.CenteredOn(c, 2);
+ foreach (var pawn2 in from pawn in map.mapPawns.AllPawnsSpawned where bound.Contains(pawn.Position) select pawn) { TaleRecorder.RecordTale(TaleDefOf.CollapseDodged, pawn2); }
+ }
+
+ private static int AdjacentUnroofedTiles(IntVec3 c, Map map)
+ {
+ var adjacent = 0;
+ for (var side = 0; side < 3; side++)
+ {
+ RoofDef roof;
+ switch (side)
+ {
+ case 0:
+ roof = map.roofGrid.RoofAt(c.x, c.z - 1);
+ break;
+ case 1:
+ roof = map.roofGrid.RoofAt(c.x + 1, c.z);
+ break;
+ case 2:
+ roof = map.roofGrid.RoofAt(c.x, c.z + 1);
+ break;
+ case 3:
+ roof = map.roofGrid.RoofAt(c.x - 1, c.z);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+
+ if (roof == null) { adjacent++; }
+ }
+
+ return adjacent;
+ }
+ }
+}
diff --git a/Source/Properties/AssemblyInfo.cs b/Source/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..96773b5
--- /dev/null
+++ b/Source/Properties/AssemblyInfo.cs
@@ -0,0 +1,7 @@
+using System.Reflection;
+
+[assembly: AssemblyTitle("Collapser")]
+[assembly: AssemblyProduct("Collapser")]
+[assembly: AssemblyCopyright("© Jaxe")]
+[assembly: AssemblyVersion("1.0")]
+[assembly: AssemblyFileVersion("1.0")]