Skip to content

Commit a0047d6

Browse files
committedMay 30, 2021
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+2-2
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

‎src/script/lua_api/l_nodetimer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void NodeTimerRef::Register(lua_State *L)
122122

123123
lua_pop(L, 1); // drop metatable
124124

125-
luaL_openlib(L, 0, methods, 0); // fill methodtable
125+
luaL_register(L, nullptr, methods); // fill methodtable
126126
lua_pop(L, 1); // drop methodtable
127127

128128
// Cannot be created from Lua

‎src/script/lua_api/l_noise.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void LuaPerlinNoise::Register(lua_State *L)
122122

123123
lua_pop(L, 1);
124124

125-
luaL_openlib(L, 0, methods, 0);
125+
luaL_register(L, nullptr, methods);
126126
lua_pop(L, 1);
127127

128128
lua_register(L, className, create_object);
@@ -380,7 +380,7 @@ void LuaPerlinNoiseMap::Register(lua_State *L)
380380

381381
lua_pop(L, 1);
382382

383-
luaL_openlib(L, 0, methods, 0);
383+
luaL_register(L, nullptr, methods);
384384
lua_pop(L, 1);
385385

386386
lua_register(L, className, create_object);
@@ -485,7 +485,7 @@ void LuaPseudoRandom::Register(lua_State *L)
485485

486486
lua_pop(L, 1);
487487

488-
luaL_openlib(L, 0, methods, 0);
488+
luaL_register(L, nullptr, methods);
489489
lua_pop(L, 1);
490490

491491
lua_register(L, className, create_object);
@@ -584,7 +584,7 @@ void LuaPcgRandom::Register(lua_State *L)
584584

585585
lua_pop(L, 1);
586586

587-
luaL_openlib(L, 0, methods, 0);
587+
luaL_register(L, nullptr, methods);
588588
lua_pop(L, 1);
589589

590590
lua_register(L, className, create_object);
@@ -699,7 +699,7 @@ void LuaSecureRandom::Register(lua_State *L)
699699

700700
lua_pop(L, 1);
701701

702-
luaL_openlib(L, 0, methods, 0);
702+
luaL_register(L, nullptr, methods);
703703
lua_pop(L, 1);
704704

705705
lua_register(L, className, create_object);

‎src/script/lua_api/l_object.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2311,7 +2311,7 @@ void ObjectRef::Register(lua_State *L)
23112311

23122312
lua_pop(L, 1); // drop metatable
23132313

2314-
luaL_openlib(L, 0, methods, 0); // fill methodtable
2314+
luaL_register(L, nullptr, methods); // fill methodtable
23152315
lua_pop(L, 1); // drop methodtable
23162316
}
23172317

‎src/script/lua_api/l_playermeta.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void PlayerMetaRef::Register(lua_State *L)
9797

9898
lua_pop(L, 1); // drop metatable
9999

100-
luaL_openlib(L, 0, methods, 0);
100+
luaL_register(L, nullptr, methods);
101101
lua_pop(L, 1);
102102

103103
// Cannot be created from Lua

‎src/script/lua_api/l_settings.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ void LuaSettings::Register(lua_State* L)
334334

335335
lua_pop(L, 1); // drop metatable
336336

337-
luaL_openlib(L, 0, methods, 0); // fill methodtable
337+
luaL_register(L, nullptr, methods); // fill methodtable
338338
lua_pop(L, 1); // drop methodtable
339339

340340
// Can be created from Lua (Settings(filename))

‎src/script/lua_api/l_storage.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void StorageRef::Register(lua_State *L)
110110

111111
lua_pop(L, 1); // drop metatable
112112

113-
luaL_openlib(L, 0, methods, 0); // fill methodtable
113+
luaL_register(L, nullptr, methods); // fill methodtable
114114
lua_pop(L, 1); // drop methodtable
115115
}
116116

‎src/script/lua_api/l_vmanip.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ void LuaVoxelManip::Register(lua_State *L)
450450

451451
lua_pop(L, 1); // drop metatable
452452

453-
luaL_openlib(L, 0, methods, 0); // fill methodtable
453+
luaL_register(L, nullptr, methods); // fill methodtable
454454
lua_pop(L, 1); // drop methodtable
455455

456456
// Can be created from Lua (VoxelManip())

0 commit comments

Comments
 (0)
Please sign in to comment.