diff --git a/1.6/1.6/Assemblies/WulaFallenEmpire.dll b/1.6/1.6/Assemblies/WulaFallenEmpire.dll index 5da1fd38..c48554bb 100644 Binary files a/1.6/1.6/Assemblies/WulaFallenEmpire.dll and b/1.6/1.6/Assemblies/WulaFallenEmpire.dll differ diff --git a/Source/WulaFallenEmpire/Harmony/MapLifecycle_Patches.cs b/Source/WulaFallenEmpire/Harmony/MapLifecycle_Patches.cs deleted file mode 100644 index ad127100..00000000 --- a/Source/WulaFallenEmpire/Harmony/MapLifecycle_Patches.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using HarmonyLib; -using RimWorld.Planet; -using Verse; - -namespace WulaFallenEmpire -{ - [HarmonyPatch(typeof(MapParent), "ShouldRemoveMapNow")] - [HarmonyPriority(600)] - public static class MapParent_ShouldRemoveMapNow_Patch - { - public static void Postfix(ref bool __result, MapParent __instance) - { - // 如果游戏本来就不打算删除,或者地图不存在,我们什么都不做 - if (!__result || !__instance.HasMap) - { - return; - } - - try - { - // 检查地图上是否存在一个“活着”的武装穿梭机 - if (WulaMapProtectionHelper.ShouldProtectMap(__instance.Map)) - { - // 游戏打算删除,但我们的逻辑说现在还不行,所以直接覆盖结果。 - // 因为 ShouldRemoveMapNow 会被周期性调用,所以这是安全的。 - __result = false; - } - } - catch (Exception arg) - { - Log.Error($"[WULA] Error in MapParent_ShouldRemoveMapNow_Patch: {arg}"); - } - } - } -} diff --git a/Source/WulaFallenEmpire/Harmony/WulaMapProtectionHelper.cs b/Source/WulaFallenEmpire/Harmony/WulaMapProtectionHelper.cs deleted file mode 100644 index 17599e24..00000000 --- a/Source/WulaFallenEmpire/Harmony/WulaMapProtectionHelper.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Linq; -using Verse; - -namespace WulaFallenEmpire -{ - public static class WulaMapProtectionHelper - { - public static bool ShouldProtectMap(Map map) - { - if (map == null) - { - return false; - } - try - { - // 检查地图上是否存在一个口袋空间已经初始化的武装穿梭机 - // 只要地图上存在一个活着的武装穿梭机,就保护地图 - return map.listerThings.AllThings.OfType() - .Any(shuttle => shuttle != null && shuttle.Spawned && !shuttle.Destroyed); - } - catch (Exception arg) - { - Log.Error($"[WULA] Error in WulaMapProtectionHelper.ShouldProtectMap: {arg}"); - return false; - } - } - } -} \ No newline at end of file diff --git a/Source/WulaFallenEmpire/WulaFallenEmpire.csproj b/Source/WulaFallenEmpire/WulaFallenEmpire.csproj index 4a7ddad6..deb52a54 100644 --- a/Source/WulaFallenEmpire/WulaFallenEmpire.csproj +++ b/Source/WulaFallenEmpire/WulaFallenEmpire.csproj @@ -1,5 +1,6 @@  - + Debug @@ -203,10 +204,6 @@ - - - -