From a9d98dcbb944e73c9a022b3803a39041217d07b5 Mon Sep 17 00:00:00 2001 From: Falki-git <72734856+Falki-git@users.noreply.github.com> Date: Mon, 26 Feb 2024 18:28:07 +0100 Subject: [PATCH 1/2] Add AlwaysAllowEVA hack. --- .../Hacks/AlwaysAllowEVA/AlwaysAllowEVA.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/KerbalLifeHacks/Hacks/AlwaysAllowEVA/AlwaysAllowEVA.cs diff --git a/src/KerbalLifeHacks/Hacks/AlwaysAllowEVA/AlwaysAllowEVA.cs b/src/KerbalLifeHacks/Hacks/AlwaysAllowEVA/AlwaysAllowEVA.cs new file mode 100644 index 0000000..c5e156b --- /dev/null +++ b/src/KerbalLifeHacks/Hacks/AlwaysAllowEVA/AlwaysAllowEVA.cs @@ -0,0 +1,25 @@ +using HarmonyLib; +using KSP.Sim.impl; + +namespace KerbalLifeHacks.Hacks.AlwaysAllowEVA; + +/// +/// Ported over from EVA ANARCHY by ThunderousEcho, with blessing from the original author +/// Original repository: https://github.com/ThunderousEcho/EvaAnarchy +/// +[Hack(name: "Allows EVA even when EVA is disabled due to an obstacle.", isEnabledByDefault: false)] +public class AlwaysAllowEVA : BaseHack +{ + public override void OnInitialized() + { + HarmonyInstance.PatchAll(typeof(AlwaysAllowEVA)); + } + + [HarmonyPatch(typeof(IVAPortraitEVAObstacleDetector), nameof(IVAPortraitEVAObstacleDetector.IsEVADisabledByObstacle))] + [HarmonyPrefix] + public static bool IVAPortraitEVAObstacleDetector_IsEVADisabledByObstacle(ref bool __result) + { + __result = false; + return false; + } +} \ No newline at end of file From 23cd422352018365d5994cf0cd2e9fbe9efd955c Mon Sep 17 00:00:00 2001 From: Falki-git <72734856+Falki-git@users.noreply.github.com> Date: Mon, 26 Feb 2024 18:28:25 +0100 Subject: [PATCH 2/2] Update README with AlwaysAllowEVA. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ea7fca4..eafc380 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Currently, this mod includes the following life hacks: SOI change. - **Orbital Line Colors** by [munix](https://github.com/jan-bures) - Colors the various orbital lines of the current vessel to make them easier to distinguish. +- **Always Allow EVA** by [Falki](https://github.com/Falki-git) - Allows EVA even when EVA is disabled due to an obstacle. *Disabled by default, see the [Configuration](#Configuration) section for details.* #### VAB - **VAB Mission Tracker** by [munix](https://github.com/jan-bures) - Adds the Mission Tracker button to the VAB app tray.