Added CLR Type-search to GetTypesByName. Fixed error caused by generic type searching from Lua.

This commit is contained in:
MapleWheels
2023-09-22 12:21:05 -04:00
committed by Evil Factory
parent 5e03954afe
commit 27c8a3ca2e
@@ -240,9 +240,16 @@ public partial class AssemblyManager
try try
{ {
// fallback to Type.GetType // fallback to Type.GetType
Type t = Type.GetType(typeName, false, false);
if (t is not null)
{
types.Add(byRef ? t.MakeByRefType() : t);
return types;
}
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{ {
Type t = assembly.GetType(typeName, false, false); t = assembly.GetType(typeName, false, false);
if (t is not null) if (t is not null)
types.Add(byRef ? t.MakeByRefType() : t); types.Add(byRef ? t.MakeByRefType() : t);
} }