mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-19 15:51:58 +00:00
29 lines
749 B
C#
29 lines
749 B
C#
using System;
|
|
using HarmonyLib;
|
|
|
|
namespace EHR.Patches;
|
|
|
|
// By https://github.com/TouseefX
|
|
[HarmonyPatch]
|
|
internal static class ButtonClickCrashFix
|
|
{
|
|
[HarmonyPatch(typeof(PassiveButton), nameof(PassiveButton.ReceiveClickDown)), HarmonyPrefix]
|
|
public static bool ReceiveClickDownPrefix(PassiveButton __instance)
|
|
{
|
|
return __instance != null
|
|
#if IL2CPP
|
|
&& __instance.Pointer != IntPtr.Zero
|
|
#endif
|
|
;
|
|
}
|
|
|
|
[HarmonyPatch(typeof(PassiveButton), nameof(PassiveButton.ReceiveClickUp)), HarmonyPrefix]
|
|
public static bool ReceiveClickUpPrefix(PassiveButton __instance)
|
|
{
|
|
return __instance != null
|
|
#if IL2CPP
|
|
&& __instance.Pointer != IntPtr.Zero
|
|
#endif
|
|
;
|
|
}
|
|
} |