Skip to content

Commit 48f3f59

Browse files
committedJul 4, 2016
Implement some safety mechanisms
1 parent f8f1f3b commit 48f3f59

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed
 

Diff for: ‎worldedit_commands/cuboid.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ minetest.register_chatcommand("/shift", {
109109
end
110110

111111
if axis == nil or dir == nil then
112-
return false, "Invalid"
112+
return false, "Invalid if looking straight up or down"
113113
end
114114

115115
assert(worldedit.cuboid_shift(name, axis, amount * dir))

Diff for: ‎worldedit_commands/cuboidapi.lua

+14-4
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,23 @@ worldedit.translate_direction = function(name, direction)
215215
end
216216

217217
if direction == "front" then
218-
resaxis = axis
219-
resdir = dir
218+
if axis == "y" then
219+
resaxis = nil
220+
resdir = nil
221+
else
222+
resaxis = axis
223+
resdir = dir
224+
end
220225
end
221226

222227
if direction == "back" then
223-
resaxis = axis
224-
resdir = -dir
228+
if axis == "y" then
229+
resaxis = nil
230+
resdir = nil
231+
else
232+
resaxis = axis
233+
resdir = -dir
234+
end
225235
end
226236

227237
if direction == "left" then

0 commit comments

Comments
 (0)
Please sign in to comment.