From 678730ed0fa1da3f40599ba29a4c3356dc122ed1 Mon Sep 17 00:00:00 2001 From: miniduikboot Date: Fri, 2 Dec 2022 19:33:58 +0100 Subject: [PATCH] Fix Game lists not working on legacy mm servers This happens because InnerNetClient.CoConnect now sets the default LastDisconnectReason to Unknown instead of ExitGame, which breaks the public game list screen. Co-Authored-By: Edward Smale --- Reactor/Patches/Fixes/CoFindGamePatch.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Reactor/Patches/Fixes/CoFindGamePatch.cs diff --git a/Reactor/Patches/Fixes/CoFindGamePatch.cs b/Reactor/Patches/Fixes/CoFindGamePatch.cs new file mode 100644 index 0000000..12fd66b --- /dev/null +++ b/Reactor/Patches/Fixes/CoFindGamePatch.cs @@ -0,0 +1,18 @@ +using HarmonyLib; + +namespace Reactor.Patches.Fixes; + +/// +/// Fixes Game Lists not working on servers using legacy matchmaking. +/// +[HarmonyPatch(typeof(AmongUsClient._CoFindGame_d__3), nameof(AmongUsClient._CoFindGame_d__3.MoveNext))] +internal static class CoFindGamePatch +{ + public static void Prefix() + { + if (AmongUsClient.Instance.LastDisconnectReason == DisconnectReasons.Unknown) + { + AmongUsClient.Instance.LastDisconnectReason = DisconnectReasons.ExitGame; + } + } +}