Skip to content

Commit

Permalink
pop extra nil value if checkType with Type argument
Browse files Browse the repository at this point in the history
 fix byref base type
  • Loading branch information
pangweiwei committed Oct 16, 2015
1 parent b5f9584 commit 3dd3b39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions Assets/Slua/Editor/LuaCodeGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1708,17 +1708,13 @@ bool IsValueType(Type t)

bool IsBaseType(Type t)
{
if (t.IsByRef) t = t.GetElementType();
return t.IsPrimitive
|| t == typeof(Color)
|| t == typeof(Vector2)
|| t == typeof(Vector3)
|| t == typeof(Vector4)
|| t == typeof(Quaternion)
|| t.Name == "Color2&"
|| t.Name == "Vector2&"
|| t.Name == "Vector3&"
|| t.Name == "Vector4&"
|| t.Name == "Quaternion&";
|| t == typeof(Quaternion);
}

string FullName(string str)
Expand Down
2 changes: 1 addition & 1 deletion Assets/Slua/Script/LuaObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ static public bool checkType(IntPtr l, int p, out Type t)
LuaDLL.lua_pushstring(l, "__fullname");
LuaDLL.lua_rawget(l, p);
tname = LuaDLL.lua_tostring(l, -1);
LuaDLL.lua_pop(l, 1);
LuaDLL.lua_pop(l, 2);
}
break;

Expand Down

0 comments on commit 3dd3b39

Please sign in to comment.