Skip to content

Commit d52f3d6

Browse files
committedMay 15, 2013
Add //unmark chat command, fix position setting not being reset by //reset.
1 parent cedecac commit d52f3d6

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
 

Diff for: ‎Chat Commands.md

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ Show markers at the region positions.
1414

1515
//mark
1616

17+
### //unmark
18+
19+
Hide markers if currently shown.
20+
21+
//unmark
22+
1723
### //pos1
1824

1925
Set WorldEdit region position 1 to the player's location.

Diff for: ‎worldedit_commands/init.lua

+17
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ minetest.register_chatcommand("/reset", {
3636
worldedit.pos2[name] = nil
3737
worldedit.mark_pos1(name)
3838
worldedit.mark_pos2(name)
39+
worldedit.set_pos[name] = nil
3940
minetest.chat_send_player(name, "WorldEdit region reset", false)
4041
end,
4142
})
@@ -51,6 +52,22 @@ minetest.register_chatcommand("/mark", {
5152
end,
5253
})
5354

55+
minetest.register_chatcommand("/unmark", {
56+
params = "",
57+
description = "Hide markers if currently shown",
58+
privs = {worldedit=true},
59+
func = function(name, param)
60+
local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
61+
worldedit.pos1[name] = nil
62+
worldedit.pos2[name] = nil
63+
worldedit.mark_pos1(name)
64+
worldedit.mark_pos2(name)
65+
worldedit.pos1[name] = pos1
66+
worldedit.pos2[name] = pos2
67+
minetest.chat_send_player(name, "WorldEdit region unmarked", false)
68+
end,
69+
})
70+
5471
minetest.register_chatcommand("/pos1", {
5572
params = "",
5673
description = "Set WorldEdit region position 1 to the player's location",

0 commit comments

Comments
 (0)
Please sign in to comment.