Try to fix old node breakers dropping items
authorNovatux <nathanael.courant@laposte.net>
Sun, 8 Jun 2014 20:49:30 +0000 (22:49 +0200)
committerNovatux <nathanael.courant@laposte.net>
Sun, 8 Jun 2014 20:49:30 +0000 (22:49 +0200)
node_breaker.lua

index b6eb8acbe8c7c0d6adae215058ad1868a7d09269..21c5194003edf082b4c0c94e4c79333122f14ddb 100644 (file)
@@ -96,6 +96,12 @@ local function break_node (pos, facedir)
        --end
        local meta = minetest.get_meta(pos)
        local inv = meta:get_inventory()
+       
+       if inv:get_size("ghost_pick") ~= 1 then -- Legacy code
+               inv:set_size("ghost_pick", 1)
+               inv:set_size("main", 100)
+       end
+
        local pick_inv = "pick"
        local pick = inv:get_stack("pick", 1)
        if pick:is_empty() then