summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony <azhang9@gmail.com>2012-09-10 17:06:34 -0700
committerAnthony <azhang9@gmail.com>2012-09-10 17:06:34 -0700
commit8102eb982e2957a59be749ec0ab867293c5ff721 (patch)
treee35b1a60323650cf9df36a6e20f4a6c87ddc00ee
parenta429e104a24b4d218733056dff4d681ec76036da (diff)
parent93100a20be1cd2109c62b053ba3e22cb9f999983 (diff)
Merge pull request #11 from khonkhortisan/master
Allow multiple //moves
-rw-r--r--README.md2
-rw-r--r--functions.lua2
-rw-r--r--init.lua6
3 files changed, 8 insertions, 2 deletions
diff --git a/README.md b/README.md
index 00e9f56..f76b9bd 100644
--- a/README.md
+++ b/README.md
@@ -129,7 +129,7 @@ Copy the current WorldEdit region along the x/y/z/? axis by <amount> nodes.
### //move x/y/z/? <amount>
-Move the current WorldEdit region along the x/y/z/? axis by <amount> nodes.
+Move the current WorldEdit positions and region along the x/y/z/? axis by <amount> nodes.
//move x 15
//move y -7
diff --git a/functions.lua b/functions.lua
index 00f73fc..ed20591 100644
--- a/functions.lua
+++ b/functions.lua
@@ -309,7 +309,7 @@ worldedit.copy = function(pos1, pos2, axis, amount)
return worldedit.volume(pos1, pos2)
end
---moves the region defined by positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z") by `amount` nodes, returning the number of nodes moved
+--moves positions `pos1` and `pos2` and the region defined by them along the `axis` axis ("x" or "y" or "z") by `amount` nodes, returning the number of nodes moved
worldedit.move = function(pos1, pos2, axis, amount)
local pos1, pos2 = worldedit.sort_pos(pos1, pos2)
local env = minetest.env
diff --git a/init.lua b/init.lua
index dcac756..1948bcf 100644
--- a/init.lua
+++ b/init.lua
@@ -323,6 +323,12 @@ minetest.register_chatcommand("/move", {
end
local count = worldedit.move(pos1, pos2, axis, tonumber(amount))
+
+ worldedit.pos1[name][axis] = worldedit.pos1[name][axis] + amount
+ worldedit.pos2[name][axis] = worldedit.pos2[name][axis] + amount
+ worldedit.mark_pos1(name)
+ worldedit.mark_pos2(name)
+
minetest.chat_send_player(name, count .. " nodes moved")
end,
})