forked from mtcontrib/spears
Update file functions.lua
This commit is contained in:
parent
57c840451c
commit
60c0656cd1
|
@ -15,10 +15,10 @@ function spears_throw (itemstack, player, pointed_thing)
|
||||||
local check_node = spears_check_node(node.name)
|
local check_node = spears_check_node(node.name)
|
||||||
if check_node == nil then
|
if check_node == nil then
|
||||||
return false
|
return false
|
||||||
elseif check_node == SPEARS_NODE_CRACKY then
|
elseif check_node == 'cracky' then
|
||||||
minetest.sound_play("default_metal_footstep", {pos = pointed_a}, true)
|
minetest.sound_play("default_metal_footstep", {pos = pointed_a}, true)
|
||||||
return false
|
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)
|
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:set_rotation(rotation)
|
||||||
spear_object:get_luaentity()._wear = wear
|
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
|
if self._stickpos ~= nil then -- Spear is stuck
|
||||||
local node = minetest.get_node(self._stickpos)
|
local node = minetest.get_node(self._stickpos)
|
||||||
local check_node = spears_check_node(node.name)
|
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()
|
self.object:remove()
|
||||||
minetest.add_item(pos, {name='spears:spear_' .. spear_type, wear = wear})
|
minetest.add_item(pos, {name='spears:spear_' .. spear_type, wear = wear})
|
||||||
return false
|
return false
|
||||||
|
@ -107,7 +107,7 @@ function spears_set_entity(spear_type, base_damage, toughness)
|
||||||
-- Hit a node?
|
-- Hit a node?
|
||||||
local node = minetest.get_node(spearhead_pos)
|
local node = minetest.get_node(spearhead_pos)
|
||||||
local check_node = spears_check_node(node.name)
|
local check_node = spears_check_node(node.name)
|
||||||
if check_node == SPEARS_NODE_UNKNOWN then
|
if check_node == nil then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
minetest.add_item(pos, {name='spears:spear_' .. spear_type, wear = wear})
|
minetest.add_item(pos, {name='spears:spear_' .. spear_type, wear = wear})
|
||||||
elseif check_node ~= 'through' then
|
elseif check_node ~= 'through' then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user