Skip to content

Commit a0047d6

Browse files
committed
script: Replace calls to depreated luaL_openlib
1 parent a12017c commit a0047d6

17 files changed

+22
-22
lines changed

src/script/lua_api/l_areastore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ void LuaAreaStore::Register(lua_State *L)
372372

373373
lua_pop(L, 1); // drop metatable
374374

375-
luaL_openlib(L, 0, methods, 0); // fill methodtable
375+
luaL_register(L, nullptr, methods); // fill methodtable
376376
lua_pop(L, 1); // drop methodtable
377377

378378
// Can be created from Lua (AreaStore())

src/script/lua_api/l_camera.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void LuaCamera::Register(lua_State *L)
219219

220220
lua_pop(L, 1);
221221

222-
luaL_openlib(L, 0, methods, 0);
222+
luaL_register(L, nullptr, methods);
223223
lua_pop(L, 1);
224224
}
225225

src/script/lua_api/l_env.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ void LuaRaycast::Register(lua_State *L)
228228

229229
lua_pop(L, 1);
230230

231-
luaL_openlib(L, 0, methods, 0);
231+
luaL_register(L, nullptr, methods);
232232
lua_pop(L, 1);
233233

234234
lua_register(L, className, create_object);

src/script/lua_api/l_inventory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ void InvRef::Register(lua_State *L)
456456

457457
lua_pop(L, 1); // drop metatable
458458

459-
luaL_openlib(L, 0, methods, 0); // fill methodtable
459+
luaL_register(L, nullptr, methods); // fill methodtable
460460
lua_pop(L, 1); // drop methodtable
461461

462462
// Cannot be created from Lua

src/script/lua_api/l_item.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ void LuaItemStack::Register(lua_State *L)
483483

484484
lua_pop(L, 1); // drop metatable
485485

486-
luaL_openlib(L, 0, methods, 0); // fill methodtable
486+
luaL_register(L, nullptr, methods); // fill methodtable
487487
lua_pop(L, 1); // drop methodtable
488488

489489
// Can be created from Lua (ItemStack(itemstack or itemstring or table or nil))

src/script/lua_api/l_itemstackmeta.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void ItemStackMetaRef::Register(lua_State *L)
114114

115115
lua_pop(L, 1); // drop metatable
116116

117-
luaL_openlib(L, 0, methods, 0); // fill methodtable
117+
luaL_register(L, nullptr, methods); // fill methodtable
118118
lua_pop(L, 1); // drop methodtable
119119

120120
// Cannot be created from Lua

src/script/lua_api/l_localplayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ void LuaLocalPlayer::Register(lua_State *L)
446446

447447
lua_pop(L, 1); // Drop metatable
448448

449-
luaL_openlib(L, 0, methods, 0); // fill methodtable
449+
luaL_register(L, nullptr, methods); // fill methodtable
450450
lua_pop(L, 1); // Drop methodtable
451451
}
452452

src/script/lua_api/l_minimap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ void LuaMinimap::Register(lua_State *L)
211211

212212
lua_pop(L, 1); // drop metatable
213213

214-
luaL_openlib(L, 0, methods, 0); // fill methodtable
214+
luaL_register(L, nullptr, methods); // fill methodtable
215215
lua_pop(L, 1); // drop methodtable
216216
}
217217

src/script/lua_api/l_modchannels.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ void ModChannelRef::Register(lua_State *L)
107107

108108
lua_pop(L, 1); // Drop metatable
109109

110-
luaL_openlib(L, 0, methods, 0); // fill methodtable
110+
luaL_register(L, nullptr, methods); // fill methodtable
111111
lua_pop(L, 1); // Drop methodtable
112112
}
113113

src/script/lua_api/l_nodemeta.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ void NodeMetaRef::RegisterCommon(lua_State *L)
234234
void NodeMetaRef::Register(lua_State *L)
235235
{
236236
RegisterCommon(L);
237-
luaL_openlib(L, 0, methodsServer, 0); // fill methodtable
237+
luaL_register(L, nullptr, methodsServer); // fill methodtable
238238
lua_pop(L, 1); // drop methodtable
239239
}
240240

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

0 commit comments

Comments
 (0)