Fix an issue where original disconnect handler is never called

This commit is contained in:
js6pak committed 2021-05-10 08:39:57 +02:00
1 parent 8219539f9b
commit a925a5355e
1 file changed
+7 -4
+7 -4
View File
@@ -112,10 +112,13 @@ namespace Reactor.Networking.Patches
var coroutine = Coroutines.Start(Coroutine(__instance));
__instance.Disconnected = (Action<Il2CppSystem.Object, DisconnectedEventArgs>) ((_, _) =>
{
Coroutines.Stop(coroutine);
});
__instance.Disconnected = Il2CppSystem.Delegate.Combine(
(Il2CppSystem.EventHandler<DisconnectedEventArgs>) (Action<Il2CppSystem.Object, DisconnectedEventArgs>) ((_, _) =>
{
Coroutines.Stop(coroutine);
}),
__instance.Disconnected
).Cast<Il2CppSystem.EventHandler<DisconnectedEventArgs>>();
});
}