mirror of
https://github.com/ElCeejo/animalia.git
synced 2025-04-30 05:21:40 -04:00
Added nil check
This commit is contained in:
parent
d41679d41d
commit
b548582ae1
1 changed files with 4 additions and 3 deletions
|
@ -914,8 +914,9 @@ function animalia.hq_wander_ranged(self, prty)
|
|||
pos.z + random(-1, 1)
|
||||
)
|
||||
local node = minetest.get_node(random_goal)
|
||||
if minetest.registered_nodes[node.name].drawtype == "liquid"
|
||||
or minetest.registered_nodes[node.name].walkable then
|
||||
if node.name
|
||||
and (minetest.registered_nodes[node.name].drawtype == "liquid"
|
||||
or minetest.registered_nodes[node.name].walkable) then
|
||||
random_goal = nil
|
||||
end
|
||||
if self.lasso_pos
|
||||
|
@ -1512,4 +1513,4 @@ function animalia.head_tracking(self)
|
|||
end
|
||||
move_head(self, tyaw, dir.y)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue