From dc598bb21c97f8fe23e5007e99fee0764e7771d9 Mon Sep 17 00:00:00 2001 From: NatureFreshMilk Date: Mon, 29 Jul 2019 13:24:21 +0200 Subject: [PATCH] on_step logic --- cannon.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cannon.lua b/cannon.lua index a9bec82..c4acd69 100644 --- a/cannon.lua +++ b/cannon.lua @@ -42,8 +42,11 @@ local register_spacecannon = function(def) end local node = minetest.get_node(pos) + local node_def = minetest.registered_nodes[node.name] - if node.name == "air" or node.name == "vacuum:vacuum" then + local goes_through = not node_def.walkable + + if goes_through then local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 1) local collided = false for k, obj in pairs(objs) do @@ -61,7 +64,7 @@ local register_spacecannon = function(def) self.object:remove() end - elseif node.name ~= "air" and node.name ~= "vacuum:vacuum" then + else -- collision spacecannon.destroy(pos, def.range, def.intensity) self.object:remove()