fix check for IsParamsArray

fixes #3513
This commit is contained in:
CasualPokePlayer 2023-01-10 05:53:58 -08:00
parent cd1d647d72
commit b11bb4fc22
2 changed files with 3 additions and 20 deletions

View File

@ -1549,26 +1549,9 @@ namespace NLua
if (!currentNetParam.GetCustomAttributes(typeof(ParamArrayAttribute), false).Any())
return false;
bool isParamArray = nLuaParams < currentLuaParam;
LuaType luaType = luaState.Type(currentLuaParam);
if (luaType == LuaType.Table)
{
extractValue = _translator.typeChecker.GetExtractor(typeof(LuaTable));
if (extractValue != null)
return true;
}
else
{
Type paramElementType = currentNetParam.ParameterType.GetElementType();
extractValue = _translator.typeChecker.CheckLuaType(luaState, currentLuaParam, paramElementType);
if (extractValue != null)
return true;
}
return isParamArray;
var paramElementType = currentNetParam.ParameterType.GetElementType();
extractValue = _translator.typeChecker.CheckLuaType(luaState, currentLuaParam, paramElementType);
return extractValue != null;
}
}
}

Binary file not shown.