diff --git a/Source/ChangeMapEdgeHarmony.cs b/Source/ChangeMapEdgeHarmony.cs index 7eb8f5e..de72222 100644 --- a/Source/ChangeMapEdgeHarmony.cs +++ b/Source/ChangeMapEdgeHarmony.cs @@ -31,6 +31,10 @@ static ChangeMapEdgeHarmony() MethodInfo innozone_targetmethod = AccessTools.Method(typeof(Verse.GenGrid), "InNoZoneEdgeArea"); HarmonyMethod innozone_postfixmethod = new HarmonyMethod(typeof(ChangeMapEdgeHarmony).GetMethod("InNoZoneEdgeArea_Postfix")); harmony.Patch(innozone_targetmethod, ignorefunction_prefixmethod, innozone_postfixmethod); + + MethodInfo cellrect_innobuild_targetmethod = AccessTools.Method(typeof(Verse.CellRect), "InNoBuildEdgeArea"); + HarmonyMethod cellrect_innobuild_postfixmethod = new HarmonyMethod(typeof(ChangeMapEdgeHarmony).GetMethod("CellRectInNoBuildEdgeArea_Postfix")); + harmony.Patch(cellrect_innobuild_targetmethod, ignorefunction_prefixmethod, cellrect_innobuild_postfixmethod); } static Material LineMatMetaOverlay = MaterialPool.MatFrom(GenDraw.LineTexPath, ShaderDatabase.MetaOverlay); @@ -76,5 +80,10 @@ public static void InNoZoneEdgeArea_Postfix(this IntVec3 c, Map map, ref bool __ { __result = c.CloseToEdge(map, ChangeMapEdge.Instance.GetNoZoneLimit()); } + public static void CellRectInNoBuildEdgeArea_Postfix(Verse.CellRect __instance, Map map, ref bool __result) + { + int limit = ChangeMapEdge.Instance.GetNoBuildLimit(); + __result = !__instance.IsEmpty && (__instance.minX < limit || __instance.minZ < limit || __instance.maxX >= map.Size.x - limit || __instance.maxZ >= map.Size.z - limit); + } } } \ No newline at end of file diff --git a/v1.3/Assemblies/ChangeMapEdge.dll b/v1.3/Assemblies/ChangeMapEdge.dll index 0cd5a40..af4dc93 100644 Binary files a/v1.3/Assemblies/ChangeMapEdge.dll and b/v1.3/Assemblies/ChangeMapEdge.dll differ