diff options
author | Anthony Zhang <azhang9@gmail.com> | 2013-05-15 17:03:26 -0400 |
---|---|---|
committer | Anthony Zhang <azhang9@gmail.com> | 2013-05-15 17:03:26 -0400 |
commit | d52f3d649e464bf05ddb7b11a329af7a8c51aa08 (patch) | |
tree | 15b8cad412c112a22168506aef082fd78bef1b71 | |
parent | cedecac3f89892e24d841abbd875fff84b0ae46a (diff) |
Add //unmark chat command, fix position setting not being reset by //reset.
-rw-r--r-- | Chat Commands.md | 6 | ||||
-rw-r--r-- | worldedit_commands/init.lua | 17 |
2 files changed, 23 insertions, 0 deletions
diff --git a/Chat Commands.md b/Chat Commands.md index 1e26586..b3d8cfa 100644 --- a/Chat Commands.md +++ b/Chat Commands.md @@ -14,6 +14,12 @@ Show markers at the region positions. //mark
+### //unmark
+
+Hide markers if currently shown.
+
+ //unmark
+
### //pos1
Set WorldEdit region position 1 to the player's location.
diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index 93db72a..df4719c 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -36,6 +36,7 @@ minetest.register_chatcommand("/reset", { worldedit.pos2[name] = nil
worldedit.mark_pos1(name)
worldedit.mark_pos2(name)
+ worldedit.set_pos[name] = nil
minetest.chat_send_player(name, "WorldEdit region reset", false)
end,
})
@@ -51,6 +52,22 @@ minetest.register_chatcommand("/mark", { end,
})
+minetest.register_chatcommand("/unmark", {
+ params = "",
+ description = "Hide markers if currently shown",
+ privs = {worldedit=true},
+ func = function(name, param)
+ local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
+ worldedit.pos1[name] = nil
+ worldedit.pos2[name] = nil
+ worldedit.mark_pos1(name)
+ worldedit.mark_pos2(name)
+ worldedit.pos1[name] = pos1
+ worldedit.pos2[name] = pos2
+ minetest.chat_send_player(name, "WorldEdit region unmarked", false)
+ end,
+})
+
minetest.register_chatcommand("/pos1", {
params = "",
description = "Set WorldEdit region position 1 to the player's location",
|