position checks for cottages branch
parent
05b619d286
commit
64a91eb9f7
12
witches.lua
12
witches.lua
|
@ -55,10 +55,14 @@ witches.witch_types = {
|
||||||
do_custom_addendum = function(self)
|
do_custom_addendum = function(self)
|
||||||
if math.random() < .0001 and minetest.registered_nodes["fireflies:firefly"] then
|
if math.random() < .0001 and minetest.registered_nodes["fireflies:firefly"] then
|
||||||
local pos = self.object:get_pos()
|
local pos = self.object:get_pos()
|
||||||
pos.y = pos.y+1
|
if pos then
|
||||||
local pos1 = minetest.find_node_near(pos, 3, "air")
|
pos.y = pos.y+1
|
||||||
minetest.set_node(pos1, {name = "fireflies:firefly"})
|
local pos1 = minetest.find_node_near(pos, 3, "air")
|
||||||
--print("setting firefly"..minetest.pos_to_string(pos1))
|
if pos1 then
|
||||||
|
minetest.set_node(pos1, {name = "fireflies:firefly"})
|
||||||
|
--print("setting firefly"..minetest.pos_to_string(pos1))
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Reference in New Issue