Advertisement
Guest User

Untitled

a guest
Jun 16th, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. int index = 1;
  2. luaL_checktype(L, index, LUA_TTABLE);
  3.  
  4. StructureDefManager *smgr = getServer(L)->getEmergeManager()->structdef;
  5. if (!smgr) {
  6. verbosestream << "register_structure: StructureDefManager not active" << std::endl;
  7. return 0;
  8. }
  9.  
  10. StructureSection *s = new StructureSection;
  11.  
  12. s->name = getstringfield_default(L, index, "name", "");
  13. s->structure_name = getstringfield_default(L, index, "structure_name", "");
  14. lua_getfield(L, index, "volume");
  15. s->volume.X = getintfield_default(L, index, "x", 0);
  16. s->volume.Y = getintfield_default(L, index, "y", 0);
  17. s->volume.Z = getintfield_default(L, index, "z", 0);
  18. lua_pop(L, 1);
  19. verbosestream << "register_section: " << s->name << std::endl;
  20. smgr->registerSection(s);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement