diff --git a/worldedit/cuboid.lua b/worldedit/cuboid.lua index f9a647f..e8160ae 100644 --- a/worldedit/cuboid.lua +++ b/worldedit/cuboid.lua @@ -64,6 +64,8 @@ worldedit.cuboid_shift = function(name, axis, amount) return false, "undefined cuboid" end + assert(not rawequal(pos1, pos2)) -- vectors must not alias + if axis == 'x' then worldedit.pos1[name].x = pos1.x + amount worldedit.pos2[name].x = pos2.x + amount diff --git a/worldedit_commands/wand.lua b/worldedit_commands/wand.lua index b3fdcef..4952187 100644 --- a/worldedit_commands/wand.lua +++ b/worldedit_commands/wand.lua @@ -34,7 +34,7 @@ minetest.register_tool(":worldedit:wand", { local entity = pointed_thing.ref:get_luaentity() if entity and entity.name == "worldedit:pos2" then -- set pos1 = pos2 - worldedit.pos1[name] = worldedit.pos2[name] + worldedit.pos1[name] = vector.copy(worldedit.pos2[name]) worldedit.mark_pos1(name) end end @@ -59,7 +59,7 @@ minetest.register_tool(":worldedit:wand", { local entity = pointed_thing.ref:get_luaentity() if entity and entity.name == "worldedit:pos1" then -- set pos2 = pos1 - worldedit.pos2[name] = worldedit.pos1[name] + worldedit.pos2[name] = vector.copy(worldedit.pos1[name]) worldedit.mark_pos2(name) end return itemstack -- nothing consumed, nothing changed