mirror of
https://github.com/ElCeejo/animalia.git
synced 2025-04-30 13:31:39 -04:00
Update bat.lua
This commit is contained in:
parent
e1f4c8fa20
commit
8169ee7e91
1 changed files with 5 additions and 4 deletions
|
@ -19,7 +19,8 @@ local function get_home_pos(self)
|
||||||
if not home_dist
|
if not home_dist
|
||||||
or dist < home_dist then
|
or dist < home_dist then
|
||||||
n_pos.y = n_pos.y - 1
|
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
|
home_dist = dist
|
||||||
new_home = n_pos
|
new_home = n_pos
|
||||||
end
|
end
|
||||||
|
@ -183,8 +184,8 @@ creatura.register_mob("animalia:bat", {
|
||||||
center = creatura.get_ground_level(center, 8)
|
center = creatura.get_ground_level(center, 8)
|
||||||
if center.y < pos.y then
|
if center.y < pos.y then
|
||||||
local under = {x = center.x, y = center.y - 1, z = center.z}
|
local under = {x = center.x, y = center.y - 1, z = center.z}
|
||||||
if creatura.get_node_def(under).walkable
|
if creatura.get_node_def(under).walkable and
|
||||||
and not minetest.is_protected(center, "") then
|
minetest.get_node_light(center, nil) < 6 then
|
||||||
minetest.set_node(center, {name = "animalia:guano"})
|
minetest.set_node(center, {name = "animalia:guano"})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -214,4 +215,4 @@ creatura.register_mob("animalia:bat", {
|
||||||
creatura.register_spawn_item("animalia:bat", {
|
creatura.register_spawn_item("animalia:bat", {
|
||||||
col1 = "392517",
|
col1 = "392517",
|
||||||
col2 = "321b0b"
|
col2 = "321b0b"
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue