Move checking of node that should be ignore above protection checking
authorasl97 <asl97@outlook.com>
Sun, 4 May 2014 07:10:11 +0000 (15:10 +0800)
committerRealBadAngel <maciej.kasatkin@o2.pl>
Tue, 6 May 2014 02:22:51 +0000 (04:22 +0200)
firing a laser into a sky while in someone land without hitting anything but air shouldn't get anyone ban

technic/tools/mining_lasers.lua

index 50df5260920dcc3e56240bfef8098c1c6c582dde..e06c7bfb961b14202f5c53c522a5ca25cd90edca 100644 (file)
@@ -75,10 +75,6 @@ local function node_tab(z, d)
 end
 
 local function laser_node(pos, player)
-       if minetest.is_protected(pos, player:get_player_name()) then
-               minetest.record_protection_violation(pos, player:get_player_name())
-               return
-       end
        local node = minetest.get_node(pos)
        if node.name == "air"
        or node.name == "ignore"
@@ -86,6 +82,10 @@ local function laser_node(pos, player)
        or node.name == "default:lava_flowing" then
                return
        end
+       if minetest.is_protected(pos, player:get_player_name()) then
+               minetest.record_protection_violation(pos, player:get_player_name())
+               return
+       end
        if node.name == "default:water_source"
        or node.name == "default:water_flowing" then
                minetest.remove_node(pos)