Fix //load and //allocate for old WorldEdit files.

This commit is contained in:
Anthony Zhang
2012-10-22 23:17:37 -04:00
parent aa4a70d237
commit fdca506505
2 changed files with 60 additions and 2 deletions

View File

@ -663,7 +663,12 @@ minetest.register_chatcommand("/allocate", {
local value = file:read("*a")
file:close()
local nodepos1, nodepos2, count = worldedit.allocate(pos1, value)
local nodepos1, nodepos2, count
if value:find("{") then --old WorldEdit format
nodepos1, nodepos2, count = worldedit.allocate_old(pos1, value)
else --new WorldEdit format
nodepos1, nodepos2, count = worldedit.allocate(pos1, value)
end
worldedit.pos1[name] = nodepos1
worldedit.mark_pos1(name)