]> git.lizzy.rs Git - worldedit.git/commitdiff
Change all references of //dig to //fixlight, document the changes, fix a small typo.
authorAnthony Zhang <azhang9@gmail.com>
Sat, 12 Jan 2013 21:02:23 +0000 (16:02 -0500)
committerAnthony Zhang <azhang9@gmail.com>
Sat, 12 Jan 2013 21:02:23 +0000 (16:02 -0500)
Chat Commands.md
WorldEdit API.md
worldedit/manipulations.lua
worldedit_commands/init.lua

index 28db902bbd098da56d6622495a69fa593ff407fb..861f4ae338fd921699c8f8ab757ec819c1f7fb5f 100644 (file)
@@ -162,9 +162,9 @@ Rotate the current WorldEdit positions and region along the x/y/z/? axis by angl
     //rotate z 270\r
     //rotate ? -90\r
 \r
-### //dig\r
+### //fixlight\r
 \r
-Dig the current WorldEdit region.\r
+Fixes the lighting in the current WorldEdit region.\r
 \r
     //dig\r
 \r
index c6f1ace5b8d4f68ec5a34b607c943abbf28bb94d..be2270d02fd390e7e1b00a8e951351b096f49943 100644 (file)
@@ -56,11 +56,11 @@ Rotates a region defined by the positions `pos1` and `pos2` by `angle` degrees c
 \r
 Returns the number of nodes rotated, the new position 1, and the new position 2.\r
 \r
-### count = worldedit.dig(pos1, pos2)\r
+### count = worldedit.fixlight(pos1, pos2)\r
 \r
-Digs a region defined by positions `pos1` and `pos2`.\r
+Fixes the lighting in a region defined by positions `pos1` and `pos2`.\r
 \r
-Returns the number of nodes dug.\r
+Returns the number of nodes updated.\r
 \r
 Primitives\r
 ----------\r
index f5b70ee3a68cffae1ddb5ec1630d12e0ee99deb0..190308486cc1f76f5f671130398d3a870c796935 100644 (file)
@@ -304,11 +304,11 @@ worldedit.rotate = function(pos1, pos2, axis, angle)
        return count, pos1, pos2\r
 end\r
 \r
---Fixes the Lightning in a region defined by positions `pos1` and `pos2`, returning the number of nodes dug\r
+--fixes the lighting in a region defined by positions `pos1` and `pos2`, returning the number of nodes updated\r
 worldedit.fixlight = function(pos1, pos2)\r
        local pos1, pos2 = worldedit.sort_pos(pos1, pos2)\r
        local env = minetest.env\r
-       local d = 0\r
+       local count = 0\r
 \r
        local pos = {x=pos1.x, y=0, z=0}\r
        while pos.x <= pos2.x do\r
@@ -316,10 +316,9 @@ worldedit.fixlight = function(pos1, pos2)
                while pos.y <= pos2.y do\r
                        pos.z = pos1.z\r
                        while pos.z <= pos2.z do\r
-                               local node = env:get_node(pos)\r
-                               if node.name == "air" then\r
+                               if env:get_node(pos).name == "air" then\r
                                        env:dig_node(pos)\r
-                                       d = d + 1\r
+                                       count = count + 1\r
                                end\r
                                pos.z = pos.z + 1\r
                        end\r
@@ -327,5 +326,5 @@ worldedit.fixlight = function(pos1, pos2)
                end\r
                pos.x = pos.x + 1\r
        end\r
-       return d\r
+       return count\r
 end
index 756ebc4924750cba961d23852ed9f5d82bd33406..b0e15b32fb446b9169d0d364d82a3e44ee422663 100644 (file)
@@ -546,7 +546,7 @@ minetest.register_chatcommand("/rotate", {
 \r
 minetest.register_chatcommand("/fixlight", {\r
        params = "",\r
-       description = "Fix the Lightning in the current WorldEdit region",\r
+       description = "Fix the lighting in the current WorldEdit region",\r
        privs = {worldedit=true},\r
        func = function(name, param)\r
                local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]\r
@@ -556,7 +556,7 @@ minetest.register_chatcommand("/fixlight", {
                end\r
 \r
                local count = worldedit.fixlight(pos1, pos2)\r
-               minetest.chat_send_player(name, count .. " nodes dug")\r
+               minetest.chat_send_player(name, count .. " nodes updated")\r
        end,\r
 })\r
 \r