3.10 lua绑定bug

在lua_cocos2dx_physics_manual.cpp中

if (argc == 2)
{
cocos2d::Vec2* arg0;
int arg1 = 0;
cocos2d::PhysicsMaterial arg2;
do {
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, “cc.PhysicsShapePolygon:create”);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, “Invalid Native Object”);
}} while (0);
ok &= luaval_to_physics_material(tolua_S, 3, &arg2, “cc.PhysicsShapePolygon:create”);
if(!ok)
{
CC_SAFE_DELETE_ARRAY(arg0);
return 0;
}
其中
ok &= luaval_to_physics_material(tolua_S, 3, &arg2, “cc.PhysicsShapePolygon:create”);这儿会报错

原本:cocos2d::PhysicsMaterial arg2
修改为:cocos2d::PhysicsMaterial arg2 = PhysicsMaterial();

注释掉ok &= luaval_to_physics_material(tolua_S, 3, &arg2, “cc.PhysicsShapePolygon:create”);

妈蛋,认真在看看,感觉是参数个数那些错的造成的bug,这儿的if (argc == 2)应该是if (argc == 3)才对?,源代码lua_cocos2dx_physics_PhysicsShapePolygon_create中还有 if (argc == 1)和if (argc == 3)的地方是不是都应该加1,版主出来说说