Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int index = 1;
- luaL_checktype(L, index, LUA_TTABLE);
- StructureDefManager *smgr = getServer(L)->getEmergeManager()->structdef;
- if (!smgr) {
- verbosestream << "register_structure: StructureDefManager not active" << std::endl;
- return 0;
- }
- StructureSection *s = new StructureSection;
- s->name = getstringfield_default(L, index, "name", "");
- s->structure_name = getstringfield_default(L, index, "structure_name", "");
- lua_getfield(L, index, "volume");
- s->volume.X = getintfield_default(L, index, "x", 0);
- s->volume.Y = getintfield_default(L, index, "y", 0);
- s->volume.Z = getintfield_default(L, index, "z", 0);
- lua_pop(L, 1);
- verbosestream << "register_section: " << s->name << std::endl;
- smgr->registerSection(s);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement