mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-05 18:41:05 +00:00
Minor script api fixes/cleanups
This commit is contained in:
parent
5b6bc8a12b
commit
524d446757
11 changed files with 37 additions and 36 deletions
|
@ -1061,17 +1061,7 @@ int ModApiEnvMod::l_get_perlin_map(lua_State *L)
|
|||
// returns voxel manipulator
|
||||
int ModApiEnvMod::l_get_voxel_manip(lua_State *L)
|
||||
{
|
||||
GET_ENV_PTR;
|
||||
|
||||
Map *map = &(env->getMap());
|
||||
LuaVoxelManip *o = (lua_istable(L, 1) && lua_istable(L, 2)) ?
|
||||
new LuaVoxelManip(map, read_v3s16(L, 1), read_v3s16(L, 2)) :
|
||||
new LuaVoxelManip(map);
|
||||
|
||||
*(void **)(lua_newuserdata(L, sizeof(void *))) = o;
|
||||
luaL_getmetatable(L, "VoxelManip");
|
||||
lua_setmetatable(L, -2);
|
||||
return 1;
|
||||
return LuaVoxelManip::create_object(L);
|
||||
}
|
||||
|
||||
// clear_objects([options])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue