diff --git a/EHR.csproj b/EHR.csproj index cb9e872a5..c1a339457 100644 --- a/EHR.csproj +++ b/EHR.csproj @@ -29,7 +29,7 @@ - + diff --git a/Patches/ClientPatch.cs b/Patches/ClientPatch.cs index c0c2ba7cf..ec6ae373a 100644 --- a/Patches/ClientPatch.cs +++ b/Patches/ClientPatch.cs @@ -158,6 +158,7 @@ static class CheckOnlinePermissionsPatch } } +#if !ANDROID [HarmonyPatch] internal static class AuthTimeoutPatch { @@ -176,23 +177,6 @@ internal static class AuthTimeoutPatch // If you don't patch this, you still need to wait for 5 s. // I have no idea why this is happening -#if ANDROID - [HarmonyPatch(typeof(AmongUsClient._CoJoinOnlinePublicGame_d__50), nameof(AmongUsClient._CoJoinOnlinePublicGame_d__50.MoveNext))] - [HarmonyPrefix] - public static void EnableUdpMatchmakingPrefix(AmongUsClient._CoJoinOnlinePublicGame_d__50 __instance) - { - // Skip to state 1, which just calls CoJoinOnlineGameDirect - if (__instance.__1__state == 0 && !ServerManager.Instance.IsHttp) - { - __instance.__1__state = 1; - - __instance.__8__1 = new() - { - matchmakerToken = string.Empty - }; - } - } -#else [HarmonyPatch(typeof(AmongUsClient._CoJoinOnlinePublicGame_d__49), nameof(AmongUsClient._CoJoinOnlinePublicGame_d__49.MoveNext))] [HarmonyPrefix] public static void EnableUdpMatchmakingPrefix(AmongUsClient._CoJoinOnlinePublicGame_d__49 __instance) @@ -208,6 +192,5 @@ internal static class AuthTimeoutPatch }; } } -#endif - } +#endif diff --git a/Patches/DleksPatch.cs b/Patches/DleksPatch.cs index dc193b4f1..8e41d51f5 100644 --- a/Patches/DleksPatch.cs +++ b/Patches/DleksPatch.cs @@ -46,6 +46,7 @@ internal static class AllMapIconsPatch } } +#if !ANDROID [HarmonyPatch(typeof(AmongUsClient._CoStartGameHost_d__28), nameof(AmongUsClient._CoStartGameHost_d__28.MoveNext))] public static class DleksPatch { @@ -73,6 +74,7 @@ public static class DleksPatch return false; } } +#endif [HarmonyPatch(typeof(Vent), nameof(Vent.SetButtons))] public static class VentSetButtonsPatch diff --git a/Patches/ExilePatch.cs b/Patches/ExilePatch.cs index 224200bbd..7e4f5f6ee 100644 --- a/Patches/ExilePatch.cs +++ b/Patches/ExilePatch.cs @@ -200,6 +200,17 @@ internal static class ExileControllerWrapUpPatch } } +#if ANDROID + [HarmonyPatch(typeof(AirshipExileController), nameof(AirshipExileController.WrapUpAndSpawn))] + private static class AirshipExileControllerPatch + { + public static void Postfix(AirshipExileController __instance) + { + try { WrapUpPostfix(__instance.initData.networkedPlayer); } + finally { WrapUpFinalizer(); } + } + } +#else [HarmonyPatch(typeof(AirshipExileController._WrapUpAndSpawn_d__11), nameof(AirshipExileController._WrapUpAndSpawn_d__11.MoveNext))] private static class AirshipExileControllerPatch { @@ -211,6 +222,7 @@ internal static class ExileControllerWrapUpPatch finally { WrapUpFinalizer(); } } } +#endif } [HarmonyPatch(typeof(PbExileController), nameof(PbExileController.PlayerSpin))] diff --git a/Patches/IntroPatch.cs b/Patches/IntroPatch.cs index 012561a57..4dd0dcb33 100644 --- a/Patches/IntroPatch.cs +++ b/Patches/IntroPatch.cs @@ -15,15 +15,13 @@ namespace EHR; // Patch for non-host modded clients to ensure that the intro cutscene is shown correctly // and GameStates.InGame is set to true #if ANDROID -[HarmonyPatch(typeof(IntroCutscene._ShowRole_d__40), nameof(IntroCutscene._ShowRole_d__40.MoveNext))] +[HarmonyPatch(typeof(IntroCutscene), nameof(IntroCutscene))] static class ShowRoleMoveNextPatchAndroid { - public static void Postfix(IntroCutscene._ShowRole_d__40 __instance, ref bool __result) + public static void Postfix(IntroCutscene __instance) { - if (__instance.__1__state != 1 || !__result) return; - GameStates.InGame = true; - SetUpRoleTextPatch.Postfix(__instance.__4__this); + SetUpRoleTextPatch.Postfix(__instance); } } #else