Fix problems with TNT
authorNovatux <nathanael.courant@laposte.net>
Tue, 12 May 2015 14:53:04 +0000 (16:53 +0200)
committerNovatux <nathanael.courant@laposte.net>
Tue, 12 May 2015 14:53:04 +0000 (16:53 +0200)
mods/doors/init.lua
mods/tnt/init.lua

index 74c7eec67990660f68e22f154c213c25ae8c161a..ee08d954670065d606200ab314fec7cf4624da0b 100644 (file)
@@ -121,15 +121,15 @@ function doors.register_door(name, def)
                else
                        if door_type == "_b_1" or door_type == "_b_2" then
                                return function(pos, intensity)
-                                       check_and_blast(pos, name..door_type)
+                                       check_and_blast(pos, base_name .. door_type)
                                        pos.y = pos.y + 1
-                                       check_and_blast(pos, name..other_door_type)
+                                       check_and_blast(pos, base_name .. other_door_type)
                                end
                        elseif door_type == "_t_1" or door_type == "_t_2" then
                                return function(pos, intensity)
-                                       check_and_blast(pos, name..door_type)
+                                       check_and_blast(pos, base_name .. door_type)
                                        pos.y = pos.y - 1
-                                       check_and_blast(pos, name..other_door_type)
+                                       check_and_blast(pos, base_name .. other_door_type)
                                end
                        end
                end
index dfe0a2301b5155da6ed38a122426e1f6fbf30c8a..44a6be407ed31b9d829d4caec6b4d7108727fd8b 100644 (file)
@@ -80,16 +80,15 @@ local function destroy(drops, pos, cid)
                return
        end
        local def = cid_data[cid]
+       if def and def.on_blast then
+               def.on_blast(pos, 1)
+               return
+       end
        if def and def.flammable then
+               print(dump(def), dump(pos), cid)
                minetest.set_node(pos, fire_node)
        else
-               local on_blast = def.on_blast
-               if on_blast ~= nil then
-                       on_blast(pos, 1)
-                       return
-               else
-                       minetest.remove_node(pos)
-               end
+               minetest.remove_node(pos)
                if def then
                        local node_drops = minetest.get_node_drops(def.name, "")
                        for _, item in ipairs(node_drops) do