make fire charges activate target (+ fix possible crash)
parent
b0695cf233
commit
6299cd07fa
|
@ -5,6 +5,8 @@
|
|||
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local mod_target = minetest.get_modpath("mcl_target")
|
||||
|
||||
--###################
|
||||
--################### BLAZE
|
||||
--###################
|
||||
|
@ -195,13 +197,13 @@ mobs:register_arrow("mobs_mc:blaze_fireball", {
|
|||
|
||||
-- Node hit, make fire
|
||||
hit_node = function(self, pos, node)
|
||||
if node.name ~= "air" then
|
||||
local pos_above = table.copy(pos)
|
||||
pos_above.y = pos_above.y + 1
|
||||
minetest.set_node(pos_above, {name=mobs_mc.items.fire})
|
||||
if node == "air" then
|
||||
minetest.set_node(pos, {name = mobs_mc.items.fire})
|
||||
else
|
||||
local v = self.object:get_velocity()
|
||||
v = vector.normalize(v)
|
||||
if self._shot_from_dispenser and mod_target and node == "mcl_target:target_off" then
|
||||
mcl_target.hit(vector.round(pos), 0.4) --4 redstone ticks
|
||||
end
|
||||
local v = vector.normalize(self.object:get_velocity())
|
||||
local crashpos = vector.subtract(pos, v)
|
||||
local crashnode = minetest.get_node(crashpos)
|
||||
-- Set fire if node is air, or a replacable flammable node (e.g. a plant)
|
||||
|
|
Loading…
Reference in New Issue