fix mob struct spawns

This commit is contained in:
kno10 2024-11-26 17:52:47 +01:00
parent d1cede6cfd
commit 92c08d0987
1 changed files with 4 additions and 1 deletions

View File

@ -7,7 +7,7 @@ local vector_offset = vector.offset
-- check if a node is an air node
local function is_air(node)
return node == "air"
return node.name == "air"
-- todo: or: not walkable and not liquid?
end
-- 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
sp = minetest.find_nodes_in_area_under_air(p1,p2,spawnon)
end
if not sp or #sp == 0 then
minetest.log("warning", "No spawn nodes for mob "..mob.." found: "..dump(spawnon,""))
end
table.shuffle(sp)
local count = 0
local mob_def = minetest.registered_entities[mob]