From fdca506505841da24b2b51929da57ab75495276d Mon Sep 17 00:00:00 2001 From: Anthony Zhang Date: Mon, 22 Oct 2012 23:17:37 -0400 Subject: Fix //load and //allocate for old WorldEdit files. --- worldedit_commands/init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'worldedit_commands') diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index 3931df0..ad6dac8 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -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) -- cgit v1.2.3