@@ -38,7 +38,7 @@ void CLuaColShapeDefs::AddClass ( lua_State* luaVM )
38
38
lua_classfunction ( luaVM, " getShapeType" , " getColShapeType" );
39
39
40
40
lua_classvariable ( luaVM, " elementsWithin" , NULL , " getElementsWithinColShape" );
41
- lua_classvariable ( luaVM, " shape " , NULL , " getColShapeType" );
41
+ lua_classvariable ( luaVM, " shapeType " , NULL , " getColShapeType" );
42
42
43
43
lua_registerclass ( luaVM, " ColShape" , " Element" );
44
44
}
@@ -56,7 +56,29 @@ int CLuaColShapeDefs::GetColShapeType ( lua_State* luaVM )
56
56
CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine ( luaVM );
57
57
if (pLuaMain)
58
58
{
59
- lua_pushnumber ( luaVM, pColShape->GetShapeType ( ) + 1 );
59
+ switch ( pColShape->GetShapeType ( ) )
60
+ {
61
+ case 0 :
62
+ lua_pushstring (luaVM, " Circle" );
63
+ break ;
64
+ case 1 :
65
+ lua_pushstring (luaVM, " Cuboid" );
66
+ break ;
67
+ case 2 :
68
+ lua_pushstring (luaVM, " Sphere" );
69
+ break ;
70
+ case 3 :
71
+ lua_pushstring (luaVM, " Rectangle" );
72
+ break ;
73
+ case 4 :
74
+ lua_pushstring (luaVM, " Polygon" );
75
+ break ;
76
+ case 5 :
77
+ lua_pushstring (luaVM, " Tube" );
78
+ break ;
79
+ default :
80
+ lua_pushboolean (luaVM, false );
81
+ }
60
82
return 1 ;
61
83
}
62
84
}
0 commit comments