Signed by: Gabriel Pérez-Cerezo <gabriel@gpcf.eu> Fixed bug
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Mon, 27 Jun 2016 20:34:56 +0000 (22:34 +0200)
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Mon, 27 Jun 2016 20:34:56 +0000 (22:34 +0200)
init.lua

index ae7195c..d4fe534 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -211,7 +211,7 @@ protector.can_dig = function(r, pos, digger, onlyowner, infolevel)
        local pos = minetest.find_nodes_in_area(
                {x = pos.x - r, y = pos.y - r, z = pos.z - r},
                {x = pos.x + r, y = pos.y + r, z = pos.z + r},
-               {"protector:protect", "protector:protect2"})
+               {"protector:protect", "protector:protect2", "protector:protect_sell"})
 
        local meta, owner, members
 
@@ -639,7 +639,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
         if fields.cancel then
            return
         end
-        if price > atm.balance[name] then
+        if price > atm.balance[name] and not name == oldowner then
            minetest.chat_send_player(name, "Not enough money on your account. Please recharge on the atm")
            return
         else