Skip to content

Commit

Permalink
Merge pull request #13 from Falki-git/dev
Browse files Browse the repository at this point in the history
Add AlwaysAllowEVA hack
  • Loading branch information
jan-bures authored Mar 24, 2024
2 parents 365982f + 23cd422 commit 88eadf6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
25 changes: 25 additions & 0 deletions src/KerbalLifeHacks/Hacks/AlwaysAllowEVA/AlwaysAllowEVA.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using HarmonyLib;
using KSP.Sim.impl;

namespace KerbalLifeHacks.Hacks.AlwaysAllowEVA;

/// <summary>
/// Ported over from EVA ANARCHY by ThunderousEcho, with blessing from the original author
/// Original repository: https://github.com/ThunderousEcho/EvaAnarchy
/// </summary>
[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;
}
}

0 comments on commit 88eadf6

Please sign in to comment.