mirror of
https://github.com/D1GQ/BetterAmongUs.git
synced 2026-10-20 01:46:19 +00:00
Fix crashing issues when pressing UI buttons
This commit is contained in:
1 parent
88006b31f9
commit
d36273e7a9
1 file changed
+33
@@ -0,0 +1,33 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BetterAmongUs.Patches.Fixes;
|
||||
|
||||
// This fixes crashing issue when pressing UI buttons, W Innerslop!!!
|
||||
// Fix by https://github.com/TouseefX
|
||||
[HarmonyPatch]
|
||||
internal static class PassiveButtonFixPatch
|
||||
{
|
||||
[HarmonyPatch(typeof(PassiveButton), nameof(PassiveButton.ReceiveClickDown))]
|
||||
[HarmonyPrefix]
|
||||
public static bool PassiveButton_ReceiveClickDown_Prefix(PassiveButton __instance)
|
||||
{
|
||||
if (__instance == null || __instance.Pointer == IntPtr.Zero)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(PassiveButton), nameof(PassiveButton.ReceiveClickUp))]
|
||||
[HarmonyPrefix]
|
||||
public static bool PassiveButton_ReceiveClickUp_Prefix(PassiveButton __instance)
|
||||
{
|
||||
if (__instance == null || __instance.Pointer == IntPtr.Zero)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user