From 60c0656cd125c89484a2644088ccc99f1865f4ee Mon Sep 17 00:00:00 2001 From: Echoes Date: Wed, 7 Feb 2024 21:52:24 +0000 Subject: [PATCH] Update file functions.lua --- functions.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/functions.lua b/functions.lua index ed16a05..4103e54 100644 --- a/functions.lua +++ b/functions.lua @@ -15,10 +15,10 @@ function spears_throw (itemstack, player, pointed_thing) local check_node = spears_check_node(node.name) if check_node == nil then return false - elseif check_node == SPEARS_NODE_CRACKY then + elseif check_node == 'cracky' then minetest.sound_play("default_metal_footstep", {pos = pointed_a}, true) return false - elseif check_node == SPEARS_NODE_STICKY then + elseif check_node == 'sticky' then local spear_object = minetest.add_entity(vector.divide(vector.add(vector.multiply(pointed_a, 2), pointed_b), 3), spear) spear_object:set_rotation(rotation) spear_object:get_luaentity()._wear = wear @@ -80,7 +80,7 @@ function spears_set_entity(spear_type, base_damage, toughness) if self._stickpos ~= nil then -- Spear is stuck local node = minetest.get_node(self._stickpos) local check_node = spears_check_node(node.name) - if check_node ~= SPEARS_NODE_STICKY then -- Fall when node is removed + if check_node ~= 'sticky' then -- Fall when node is removed self.object:remove() minetest.add_item(pos, {name='spears:spear_' .. spear_type, wear = wear}) return false @@ -107,7 +107,7 @@ function spears_set_entity(spear_type, base_damage, toughness) -- Hit a node? local node = minetest.get_node(spearhead_pos) local check_node = spears_check_node(node.name) - if check_node == SPEARS_NODE_UNKNOWN then + if check_node == nil then self.object:remove() minetest.add_item(pos, {name='spears:spear_' .. spear_type, wear = wear}) elseif check_node ~= 'through' then