mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2025-01-07 17:17:31 +01:00
fix mob struct spawns
This commit is contained in:
parent
28a6728255
commit
4f41d0fe27
@ -7,7 +7,7 @@ local vector_offset = vector.offset
|
|||||||
|
|
||||||
-- check if a node is an air node
|
-- check if a node is an air node
|
||||||
local function is_air(node)
|
local function is_air(node)
|
||||||
return node == "air"
|
return node.name == "air"
|
||||||
-- todo: or: not walkable and not liquid?
|
-- todo: or: not walkable and not liquid?
|
||||||
end
|
end
|
||||||
-- check if a node is a water node
|
-- check if a node is a water node
|
||||||
@ -37,6 +37,9 @@ function vl_structures.spawn_mobs(mob,spawnon,p1,p2,pr,n,water)
|
|||||||
else
|
else
|
||||||
sp = minetest.find_nodes_in_area_under_air(p1,p2,spawnon)
|
sp = minetest.find_nodes_in_area_under_air(p1,p2,spawnon)
|
||||||
end
|
end
|
||||||
|
if not sp or #sp == 0 then
|
||||||
|
minetest.log("warning", "No spawn nodes for mob "..mob.." found: "..dump(spawnon,""))
|
||||||
|
end
|
||||||
table.shuffle(sp)
|
table.shuffle(sp)
|
||||||
local count = 0
|
local count = 0
|
||||||
local mob_def = minetest.registered_entities[mob]
|
local mob_def = minetest.registered_entities[mob]
|
||||||
|
Loading…
Reference in New Issue
Block a user