Skip to content

Commit

Permalink
修正:执行带返回值的委托时,无法从lua返回值
Browse files Browse the repository at this point in the history
  • Loading branch information
forsakenyang committed May 27, 2022
1 parent 250a498 commit 4eb7e86
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -651,11 +651,12 @@ bool FFunctionDesc::CallLuaInternal(lua_State *L, void *InParams, FOutParmRec *O
int32 NumResultOnStack = lua_gettop(L);
if (NumResult <= NumResultOnStack)
{
#if UNLUA_LEGACY_RETURN_ORDER
int32 OutPropertyIndex = -NumResult;
#else
int32 OutPropertyIndex = NumResult;
#if !UNLUA_LEGACY_RETURN_ORDER
if (ReturnPropertyIndex > INDEX_NONE)
OutPropertyIndex++;
#endif

OutParam = OutParams;

for (int32 i = 0; i < OutPropertyIndices.Num(); ++i)
Expand Down Expand Up @@ -686,11 +687,7 @@ bool FFunctionDesc::CallLuaInternal(lua_State *L, void *InParams, FOutParmRec *O
}
OutParam = OutParam->NextOutParm;
}
#if UNLUA_LEGACY_RETURN_ORDER
++OutPropertyIndex;
#else
--OutPropertyIndex;
#endif
}
}

Expand All @@ -708,7 +705,7 @@ bool FFunctionDesc::CallLuaInternal(lua_State *L, void *InParams, FOutParmRec *O
#if UNLUA_LEGACY_RETURN_ORDER
constexpr auto IndexInStack = -1;
#else
constexpr auto IndexInStack = 1;
const auto IndexInStack = -NumParams;
#endif

// set value for blueprint side return property
Expand Down

0 comments on commit 4eb7e86

Please sign in to comment.