From f862e808a73a9533c5275120561e0673174da3f9 Mon Sep 17 00:00:00 2001
From: Az <56699741+AlchlcDvl@users.noreply.github.com>
Date: Fri, 13 Nov 2026 21:26:20 -0500
Subject: [PATCH] support generic methods if possible
---
.../Attributes/Delegate/ModdedOptionMemberAttribute.cs | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/MiraAPI/GameOptions/Attributes/Delegate/ModdedOptionMemberAttribute.cs b/MiraAPI/GameOptions/Attributes/Delegate/ModdedOptionMemberAttribute.cs
index 10096462..8e350afd 100644
--- a/MiraAPI/GameOptions/Attributes/Delegate/ModdedOptionMemberAttribute.cs
+++ b/MiraAPI/GameOptions/Attributes/Delegate/ModdedOptionMemberAttribute.cs
@@ -261,7 +261,15 @@ public abstract class ModdedOptionMemberAttribute(string? memberName, Type? hold
/// The resolved if found; otherwise, .
protected MethodInfo? ResolveMethod(AbstractOptionGroup group, PropertyInfo property, out Type type, out MethodInfo? instanceGetter, out bool notFound)
{
- return ResolveMember(group, property, out type, out instanceGetter, out notFound) as MethodInfo;
+ var method = ResolveMember(group, property, out type, out instanceGetter, out notFound) as MethodInfo;
+
+ if (method == null)
+ return null;
+
+ if (method.IsGenericMethodDefinition)
+ method = method.MakeGenericMethod(property.PropertyType);
+
+ return method;
}
///