Fix spawn ABM check that prevented squid spawn

This commit is contained in:
Wuzzy 2019-02-05 17:43:18 +01:00
parent 64457b151c
commit b7a2fba1ce

View File

@ -1,10 +1,11 @@
function mobs:spawn_abm_check(pos, node, name) function mobs:spawn_abm_check(pos, node, name)
if (node.name == "air") then -- Don't spawn monsters on mycelium
if (node.name == "mcl_core:mycelium" or node.name == "mcl_core:mycelium_snow") and minetest.registered_entities[name].type == "monster" then
return true return true
elseif (node.name == "mcl_core:mycelium" or node.name == "mcl_core:mycelium_snow") and minetest.registered_entities[name].type == "monster" then -- Spawn on opaque or liquid nodes
return false elseif minetest.get_item_group(node.name, "opaque") ~= 0 or minetest.registered_nodes[node.name].liquidtype ~= "none" then
elseif minetest.get_item_group(node.name, "opaque") ~= 0 then
return false return false
end end
-- Reject everything else
return true return true
end end