From d4349aefd4b4f1dc8522ad08deb30e58ed360889 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Thu, 3 Dec 2020 18:51:39 +1000 Subject: [PATCH] Allow ext. tools to recieve an ApiContainer --- src/BizHawk.Client.Common/Api/ApiInjector.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/BizHawk.Client.Common/Api/ApiInjector.cs b/src/BizHawk.Client.Common/Api/ApiInjector.cs index 0898d6f8da..72727eae25 100644 --- a/src/BizHawk.Client.Common/Api/ApiInjector.cs +++ b/src/BizHawk.Client.Common/Api/ApiInjector.cs @@ -35,6 +35,9 @@ namespace BizHawk.Client.Common Type targetType = target.GetType(); object[] tmp = new object[1]; + targetType.GetProperties().FirstOrDefault(pi => pi.PropertyType == typeof(ApiContainer)) + ?.SetValue(target, source.Container); + foreach (var propinfo in targetType.GetPropertiesWithAttrib(typeof(RequiredApiAttribute))) { tmp[0] = source.GetApi(propinfo.PropertyType);