Guest User

Untitled

a guest
Apr 25th, 2013
45
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function DOM_cola_construcao(nome, ponto_inicial)
  2. local pi = {x=ponto_inicial.x,y=ponto_inicial.y,z=ponto_inicial.z}
  3. local tipo = "air"
  4. local arq = minetest.get_modpath("domb") .."/maps/"..nome.."-constr-sav.txt"
  5.  
  6. --Read the file, if is found.
  7. a, error = io.open(arq, "r")
  8. if error then return error end
  9. -- local mapa = domb_mapa
  10. local mapa = minetest.deserialize(a:read("*a"))
  11. -- local m = a:read("*a")
  12. a:close()
  13.  
  14. --DOM_inspeciona("Mapa: ",mapa)
  15. local tamanho = #(mapa)
  16.  
  17. for p=1,tamanho do
  18. if mapa[p] ~= nil then
  19. if mapa[p].o ~= nil then
  20. tipo = mapa[p].o
  21. -- meta = minetest.deserialize(mapa[p].m)
  22. m = mapa[p].m
  23. posicao = {x=mapa[p].x+pi.x,y=mapa[p].y+pi.y,z=mapa[p].z+pi.z}
  24. minetest.env:add_node(posicao, tipo)
  25. meta = minetest.env:get_meta(posicao)
  26. if m.inventory ~= nil then
  27. --DOM_inspeciona("Meta lido:",type(m),type(m.inventory),type(m.inventory.main))
  28. DOM_inspeciona("Meta lido:",m)
  29. end
  30. if m.inventory ~= nil then
  31. --DOM_inspeciona_r("Carga de meta teórica.",m.inventory)
  32. -- meta:from_table(minetest.deserialize(m.inventory))
  33. meta:from_table(m)
  34. end
  35. end
  36. end
  37. end
  38. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×