-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Falki-git/dev
Add AlwaysAllowEVA hack
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/KerbalLifeHacks/Hacks/AlwaysAllowEVA/AlwaysAllowEVA.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |