This commit is contained in:
Petras Jokubauskas 2024-09-20 23:52:03 +02:00 committed by GitHub
commit e9f2141000
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View file

@ -210,8 +210,9 @@ creatura.register_abm_spawn("animalia:bat", {
chance = ambient_spawn_chance,
interval = 30,
min_light = 0,
max_light = 6,
min_height = -31000,
max_height = 1,
max_height = 128,
min_group = 3,
max_group = 5,
spawn_cap = 6,

View file

@ -19,7 +19,8 @@ local function get_home_pos(self)
if not home_dist
or dist < home_dist then
n_pos.y = n_pos.y - 1
if creatura.get_node_def(n_pos).name == "air" then
if creatura.get_node_def(n_pos).name == "air" and
minetest.get_node_light(n_pos) < 8 then
home_dist = dist
new_home = n_pos
end
@ -144,8 +145,8 @@ creatura.register_mob("animalia:bat", {
center = creatura.get_ground_level(center, 8)
if center.y < pos.y then
local under = {x = center.x, y = center.y - 1, z = center.z}
if creatura.get_node_def(under).walkable
and not minetest.is_protected(center, "") then
if creatura.get_node_def(under).walkable and
minetest.get_node_light(center, nil) < 6 then
minetest.set_node(center, {name = "animalia:guano"})
end
end