Override using scripted type name
@@ -315,11 +315,18 @@ void FunctionOverride::Override(const std::string& acTypeName, const std::string
auto* pClassType = pRtti->GetClass(acTypeName.c_str());
if (!pClassType)
+ {
+ auto* pNativeCName = pRtti->scriptToNative.Get(RED4ext::CName(acTypeName.c_str()));
+
+ if (!pNativeCName)
{
spdlog::get("scripting")->error("Class type {} not found", acTypeName);
return;
}
+ pClassType = pRtti->GetClass(*pNativeCName);
+ }
+
auto pContext = TiltedPhoques::MakeUnique<Context>();
pContext->ScriptFunction = std::move(aFunction);
pContext->Environment = aEnvironment;
