You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--modifies positions `pos1` and `pos2` so that each component of `pos1` is less than or equal to its corresponding conent of `pos2`, returning two new positions
4
+
-- Copies and modifies positions `pos1` and `pos2` so that each component of
5
+
-- `pos1` is less than or equal to the corresponding component of `pos2`.
--executes `code` as a Lua chunk in the global namespace, returning an error if the code fails or nil otherwise
22
+
-- Executes `code` as a Lua chunk in the global namespace,
23
+
-- returning an error if the code fails, or nil otherwise.
21
24
worldedit.lua=function(code)
22
-
localoperation, message=loadstring(code)
23
-
ifoperation==nilthen--code parsing failed
24
-
returnmessage
25
+
localfunc, err=loadstring(code)
26
+
ifnotfuncthen-- Syntax error
27
+
returnerr
25
28
end
26
-
localstatus, message=pcall(operation)
27
-
ifstatus==nilthen--operation failed
28
-
returnmessage
29
+
localgood, err=pcall(operation)
30
+
ifnotgoodthen-- Runtime error
31
+
returnerr
29
32
end
30
33
returnnil
31
34
end
32
35
33
-
--executes `code` as a Lua chunk in the global namespace with the variable pos available, for each node in a region defined by positions `pos1` and `pos2`, returning an error if the code fails or nil otherwise
36
+
-- Executes `code` as a Lua chunk in the global namespace with the variable
37
+
-- pos available, for each node in a region defined by positions `pos1` and
38
+
-- `pos2`, returning an error if the code fails, or nil otherwise
Copy file name to clipboardExpand all lines: worldedit/manipulations.lua
+3-1
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,9 @@
1
1
worldedit=worldeditor {}
2
2
localminetest=minetest--local copy of global
3
3
4
-
--modifies positions `pos1` and `pos2` so that each component of `pos1` is less than or equal to its corresponding conent of `pos2`, returning two new positions
4
+
-- Copies and modifies positions `pos1` and `pos2` so that each component of
5
+
-- `pos1` is less than or equal to the corresponding component of `pos2`.
0 commit comments