mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-19 15:51:54 +00:00
Fix an issue where original disconnect handler is never called
This commit is contained in:
1 file changed
+7
-4
@@ -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>>();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user