mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2024-12-04 21:33:43 +01:00
parent
469c3bf70b
commit
a713efe051
@ -64,6 +64,8 @@ worldedit.cuboid_shift = function(name, axis, amount)
|
|||||||
return false, "undefined cuboid"
|
return false, "undefined cuboid"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
assert(not rawequal(pos1, pos2)) -- vectors must not alias
|
||||||
|
|
||||||
if axis == 'x' then
|
if axis == 'x' then
|
||||||
worldedit.pos1[name].x = pos1.x + amount
|
worldedit.pos1[name].x = pos1.x + amount
|
||||||
worldedit.pos2[name].x = pos2.x + amount
|
worldedit.pos2[name].x = pos2.x + amount
|
||||||
|
@ -34,7 +34,7 @@ minetest.register_tool(":worldedit:wand", {
|
|||||||
local entity = pointed_thing.ref:get_luaentity()
|
local entity = pointed_thing.ref:get_luaentity()
|
||||||
if entity and entity.name == "worldedit:pos2" then
|
if entity and entity.name == "worldedit:pos2" then
|
||||||
-- set pos1 = pos2
|
-- set pos1 = pos2
|
||||||
worldedit.pos1[name] = worldedit.pos2[name]
|
worldedit.pos1[name] = vector.copy(worldedit.pos2[name])
|
||||||
worldedit.mark_pos1(name)
|
worldedit.mark_pos1(name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -59,7 +59,7 @@ minetest.register_tool(":worldedit:wand", {
|
|||||||
local entity = pointed_thing.ref:get_luaentity()
|
local entity = pointed_thing.ref:get_luaentity()
|
||||||
if entity and entity.name == "worldedit:pos1" then
|
if entity and entity.name == "worldedit:pos1" then
|
||||||
-- set pos2 = pos1
|
-- set pos2 = pos1
|
||||||
worldedit.pos2[name] = worldedit.pos1[name]
|
worldedit.pos2[name] = vector.copy(worldedit.pos1[name])
|
||||||
worldedit.mark_pos2(name)
|
worldedit.mark_pos2(name)
|
||||||
end
|
end
|
||||||
return itemstack -- nothing consumed, nothing changed
|
return itemstack -- nothing consumed, nothing changed
|
||||||
|
Loading…
Reference in New Issue
Block a user