Skip to content

Commit

Permalink
fix matchType for byte[]
Browse files Browse the repository at this point in the history
  • Loading branch information
pangweiwei committed Jan 14, 2018
1 parent 3f1a7d7 commit b6a776e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Assets/Plugins/Slua_Managed/LuaObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ public static bool matchType(IntPtr l, int p, LuaTypes lt, Type t)
}
else if (t == typeof(char[]) || t==typeof(byte[]))
{
return lt == LuaTypes.LUA_TSTRING;
return lt == LuaTypes.LUA_TSTRING || lt == LuaTypes.LUA_TUSERDATA;
}

switch (lt)
Expand Down Expand Up @@ -941,6 +941,7 @@ static public bool checkArray<T>(IntPtr l, int p, out T[] ta)
}
else
{
object obj = checkObj (l, p);
Array array = checkObj(l, p) as Array;
ta = array as T[];
return ta != null;
Expand Down

0 comments on commit b6a776e

Please sign in to comment.