Skip to content

Commit

Permalink
Fix overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
maximegmd committed Dec 6, 2023
1 parent bcbd67e commit 15ebd8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/scripting/FunctionOverride.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,9 @@ void FunctionOverride::Override(
{
if (pRealFunction->flags.isNative)
{
pFunc = RED4ext::CClassStaticFunction::Create(pClassType, acFullName.c_str(), acFullName.c_str(), pExecutablePayload, pRealFunction->flags);
reinterpret_cast<RED4ext::CClassStaticFunction*>(pFunc)->parent = pRealFunction->parent;
auto* pResult = RED4ext::CClassStaticFunction::Create(pClassType, acFullName.c_str(), acFullName.c_str(), pExecutablePayload, pRealFunction->flags);
pResult->parent = pRealFunction->parent;
pFunc = pResult;
}
else
{
Expand All @@ -627,8 +628,9 @@ void FunctionOverride::Override(
}
else
{
pFunc = RED4ext::CClassFunction::Create(pClassType, acFullName.c_str(), acFullName.c_str(), pExecutablePayload, pRealFunction->flags);
reinterpret_cast<RED4ext::CClassFunction*>(pFunc)->parent = pRealFunction->parent;
auto* pResult = RED4ext::CClassFunction::Create(pClassType, acFullName.c_str(), acFullName.c_str(), pExecutablePayload, pRealFunction->flags);
pResult->parent = pRealFunction->parent;
pFunc = pResult;
}

CopyFunctionDescription(pFunc, pRealFunction, true);
Expand Down

0 comments on commit 15ebd8b

Please sign in to comment.