mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
dynamic::create_map, dynamic::create_list
This commit is contained in:
parent
7270e0ba24
commit
debdec1dc2
6 changed files with 27 additions and 9 deletions
|
|
@ -327,7 +327,7 @@ dynamic::Value lua::LuaState::tovalue(int idx) {
|
|||
int len = lua_objlen(L, idx);
|
||||
if (len) {
|
||||
// array
|
||||
auto list = std::make_shared<List>();
|
||||
auto list = create_list();
|
||||
for (int i = 1; i <= len; i++) {
|
||||
lua_rawgeti(L, idx, i);
|
||||
list->put(tovalue(-1));
|
||||
|
|
@ -336,7 +336,7 @@ dynamic::Value lua::LuaState::tovalue(int idx) {
|
|||
return list;
|
||||
} else {
|
||||
// table
|
||||
auto map = std::make_shared<Map>();
|
||||
auto map = create_map();
|
||||
lua_pushvalue(L, idx);
|
||||
lua_pushnil(L);
|
||||
while (lua_next(L, -2)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue