Navigation Menu

Skip to content

Commit

Permalink
script: Replace calls to depreated luaL_openlib
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed May 30, 2021
1 parent a12017c commit a0047d6
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/script/lua_api/l_areastore.cpp
Expand Up @@ -372,7 +372,7 @@ void LuaAreaStore::Register(lua_State *L)

lua_pop(L, 1); // drop metatable

luaL_openlib(L, 0, methods, 0); // fill methodtable
luaL_register(L, nullptr, methods); // fill methodtable
lua_pop(L, 1); // drop methodtable

// Can be created from Lua (AreaStore())
Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_camera.cpp
Expand Up @@ -219,7 +219,7 @@ void LuaCamera::Register(lua_State *L)

lua_pop(L, 1);

luaL_openlib(L, 0, methods, 0);
luaL_register(L, nullptr, methods);
lua_pop(L, 1);
}

Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_env.cpp
Expand Up @@ -228,7 +228,7 @@ void LuaRaycast::Register(lua_State *L)

lua_pop(L, 1);

luaL_openlib(L, 0, methods, 0);
luaL_register(L, nullptr, methods);
lua_pop(L, 1);

lua_register(L, className, create_object);
Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_inventory.cpp
Expand Up @@ -456,7 +456,7 @@ void InvRef::Register(lua_State *L)

lua_pop(L, 1); // drop metatable

luaL_openlib(L, 0, methods, 0); // fill methodtable
luaL_register(L, nullptr, methods); // fill methodtable
lua_pop(L, 1); // drop methodtable

// Cannot be created from Lua
Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_item.cpp
Expand Up @@ -483,7 +483,7 @@ void LuaItemStack::Register(lua_State *L)

lua_pop(L, 1); // drop metatable

luaL_openlib(L, 0, methods, 0); // fill methodtable
luaL_register(L, nullptr, methods); // fill methodtable
lua_pop(L, 1); // drop methodtable

// Can be created from Lua (ItemStack(itemstack or itemstring or table or nil))
Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_itemstackmeta.cpp
Expand Up @@ -114,7 +114,7 @@ void ItemStackMetaRef::Register(lua_State *L)

lua_pop(L, 1); // drop metatable

luaL_openlib(L, 0, methods, 0); // fill methodtable
luaL_register(L, nullptr, methods); // fill methodtable
lua_pop(L, 1); // drop methodtable

// Cannot be created from Lua
Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_localplayer.cpp
Expand Up @@ -446,7 +446,7 @@ void LuaLocalPlayer::Register(lua_State *L)

lua_pop(L, 1); // Drop metatable

luaL_openlib(L, 0, methods, 0); // fill methodtable
luaL_register(L, nullptr, methods); // fill methodtable
lua_pop(L, 1); // Drop methodtable
}

Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_minimap.cpp
Expand Up @@ -211,7 +211,7 @@ void LuaMinimap::Register(lua_State *L)

lua_pop(L, 1); // drop metatable

luaL_openlib(L, 0, methods, 0); // fill methodtable
luaL_register(L, nullptr, methods); // fill methodtable
lua_pop(L, 1); // drop methodtable
}

Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_modchannels.cpp
Expand Up @@ -107,7 +107,7 @@ void ModChannelRef::Register(lua_State *L)

lua_pop(L, 1); // Drop metatable

luaL_openlib(L, 0, methods, 0); // fill methodtable
luaL_register(L, nullptr, methods); // fill methodtable
lua_pop(L, 1); // Drop methodtable
}

Expand Down
4 changes: 2 additions & 2 deletions src/script/lua_api/l_nodemeta.cpp
Expand Up @@ -234,7 +234,7 @@ void NodeMetaRef::RegisterCommon(lua_State *L)
void NodeMetaRef::Register(lua_State *L)
{
RegisterCommon(L);
luaL_openlib(L, 0, methodsServer, 0); // fill methodtable
luaL_register(L, nullptr, methodsServer); // fill methodtable
lua_pop(L, 1); // drop methodtable
}

Expand All @@ -260,7 +260,7 @@ const luaL_Reg NodeMetaRef::methodsServer[] = {
void NodeMetaRef::RegisterClient(lua_State *L)
{
RegisterCommon(L);
luaL_openlib(L, 0, methodsClient, 0); // fill methodtable
luaL_register(L, nullptr, methodsClient); // fill methodtable
lua_pop(L, 1); // drop methodtable
}

Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_nodetimer.cpp
Expand Up @@ -122,7 +122,7 @@ void NodeTimerRef::Register(lua_State *L)

lua_pop(L, 1); // drop metatable

luaL_openlib(L, 0, methods, 0); // fill methodtable
luaL_register(L, nullptr, methods); // fill methodtable
lua_pop(L, 1); // drop methodtable

// Cannot be created from Lua
Expand Down
10 changes: 5 additions & 5 deletions src/script/lua_api/l_noise.cpp
Expand Up @@ -122,7 +122,7 @@ void LuaPerlinNoise::Register(lua_State *L)

lua_pop(L, 1);

luaL_openlib(L, 0, methods, 0);
luaL_register(L, nullptr, methods);
lua_pop(L, 1);

lua_register(L, className, create_object);
Expand Down Expand Up @@ -380,7 +380,7 @@ void LuaPerlinNoiseMap::Register(lua_State *L)

lua_pop(L, 1);

luaL_openlib(L, 0, methods, 0);
luaL_register(L, nullptr, methods);
lua_pop(L, 1);

lua_register(L, className, create_object);
Expand Down Expand Up @@ -485,7 +485,7 @@ void LuaPseudoRandom::Register(lua_State *L)

lua_pop(L, 1);

luaL_openlib(L, 0, methods, 0);
luaL_register(L, nullptr, methods);
lua_pop(L, 1);

lua_register(L, className, create_object);
Expand Down Expand Up @@ -584,7 +584,7 @@ void LuaPcgRandom::Register(lua_State *L)

lua_pop(L, 1);

luaL_openlib(L, 0, methods, 0);
luaL_register(L, nullptr, methods);
lua_pop(L, 1);

lua_register(L, className, create_object);
Expand Down Expand Up @@ -699,7 +699,7 @@ void LuaSecureRandom::Register(lua_State *L)

lua_pop(L, 1);

luaL_openlib(L, 0, methods, 0);
luaL_register(L, nullptr, methods);
lua_pop(L, 1);

lua_register(L, className, create_object);
Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_object.cpp
Expand Up @@ -2311,7 +2311,7 @@ void ObjectRef::Register(lua_State *L)

lua_pop(L, 1); // drop metatable

luaL_openlib(L, 0, methods, 0); // fill methodtable
luaL_register(L, nullptr, methods); // fill methodtable
lua_pop(L, 1); // drop methodtable
}

Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_playermeta.cpp
Expand Up @@ -97,7 +97,7 @@ void PlayerMetaRef::Register(lua_State *L)

lua_pop(L, 1); // drop metatable

luaL_openlib(L, 0, methods, 0);
luaL_register(L, nullptr, methods);
lua_pop(L, 1);

// Cannot be created from Lua
Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_settings.cpp
Expand Up @@ -334,7 +334,7 @@ void LuaSettings::Register(lua_State* L)

lua_pop(L, 1); // drop metatable

luaL_openlib(L, 0, methods, 0); // fill methodtable
luaL_register(L, nullptr, methods); // fill methodtable
lua_pop(L, 1); // drop methodtable

// Can be created from Lua (Settings(filename))
Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_storage.cpp
Expand Up @@ -110,7 +110,7 @@ void StorageRef::Register(lua_State *L)

lua_pop(L, 1); // drop metatable

luaL_openlib(L, 0, methods, 0); // fill methodtable
luaL_register(L, nullptr, methods); // fill methodtable
lua_pop(L, 1); // drop methodtable
}

Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_vmanip.cpp
Expand Up @@ -450,7 +450,7 @@ void LuaVoxelManip::Register(lua_State *L)

lua_pop(L, 1); // drop metatable

luaL_openlib(L, 0, methods, 0); // fill methodtable
luaL_register(L, nullptr, methods); // fill methodtable
lua_pop(L, 1); // drop methodtable

// Can be created from Lua (VoxelManip())
Expand Down

0 comments on commit a0047d6

Please sign in to comment.