Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Marsey/Game/Patches/BindFix.cs
Original file line number Diff line number Diff line change
@@ -2,16 +2,20 @@
using System.Reflection.Emit;
using HarmonyLib;
using Marsey.Handbreak;
using Marsey.Stealthsey;

namespace Marsey.Game.Patches;

// https://media.discordapp.net/attachments/1132440600478756879/1208211732980301964/MalPR.png?ex=65e275dc&is=65d000dc&hm=d0e99b62cca1151e13a8e4af65cbe7b0e3c4f0d35e74965ab07640f87276df93&=&format=webp&quality=lossless
// Cred: https://github.com/space-wizards/RobustToolbox/pull/4903
// Todo: Remove when
public static class BindFix
{
public static void Patch()
{
// Non-210/210.1 engine does not have a keybind issue
// todo remove somewhen in the future (never)
if (Abjure.engineVer < new Version("210.0.0") || Abjure.engineVer > new Version("210.1.0")) return;

Type Input = AccessTools.TypeByName("Robust.Client.Input.InputManager");
MethodInfo LKFmi = AccessTools.Method(Input, "LoadKeyFile");
MethodInfo BindFixTranspiler = AccessTools.Method(typeof(BindFix), "Transpiler");
6 changes: 4 additions & 2 deletions Marsey/Stealthsey/Abjure.cs
Original file line number Diff line number Diff line change
@@ -4,14 +4,16 @@ namespace Marsey.Stealthsey;

public static class Abjure
{
public static Version engineVer { get; private set; }

Check warning on line 7 in Marsey/Stealthsey/Abjure.cs

GitHub Actions / build

Non-nullable property 'engineVer' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 7 in Marsey/Stealthsey/Abjure.cs

GitHub Actions / build

Non-nullable property 'engineVer' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

/// <summary>
/// Checks against version with detection methods
/// </summary>
/// <returns>True if version is equal or over with detection and hidesey is disabled</returns>
public static bool CheckMalbox(string engineversion, HideLevel MarseyHide)
{
Version reqVersion = new Version(engineversion);
engineVer = new Version(engineversion);

return reqVersion >= MarseyVars.Detection && MarseyHide == HideLevel.Disabled;
return engineVer >= MarseyVars.Detection && MarseyHide == HideLevel.Disabled;
}
}

0 comments on commit 5770ec2

Please sign in to comment.