From cb340ce115703a4d19722849dfab2014d7b71385 Mon Sep 17 00:00:00 2001 From: David Higueros <111460331+TheDavSmasher@users.noreply.github.com> Date: Mon, 2 Nov 2026 21:47:53 -0700 Subject: [PATCH] Wrapped instance in array to make sure corrent CreateInstance is called --- MiraAPI/Patches/Events/VanillaButtonPatches.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MiraAPI/Patches/Events/VanillaButtonPatches.cs b/MiraAPI/Patches/Events/VanillaButtonPatches.cs index 070c6c7e..92946439 100644 --- a/MiraAPI/Patches/Events/VanillaButtonPatches.cs +++ b/MiraAPI/Patches/Events/VanillaButtonPatches.cs @@ -73,12 +73,12 @@ public static class VanillaButtonPatches } var eventType = typeof(VanillaButtonClickEvent<>).MakeGenericType(__instance.GetType()); - var @event = (MiraCancelableEvent)Activator.CreateInstance(eventType, __instance)!; + var @event = (MiraCancelableEvent)Activator.CreateInstance(eventType, [__instance])!; var specificInvoked = @event.InvokeEvent(eventType); if (@event.IsCancelled) { var cancelEventType = typeof(VanillaButtonCancelledEvent<>).MakeGenericType(__instance.GetType()); - var cancelEvent = (MiraEvent)Activator.CreateInstance(cancelEventType, __instance)!; + var cancelEvent = (MiraEvent)Activator.CreateInstance(cancelEventType, [__instance])!; cancelEvent.InvokeEvent(cancelEventType); }