mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-04-01 09:50:23 +02:00
nil check for do_stay_near
This commit is contained in:
parent
b6fb1948e8
commit
f14050ad3c
4
api.lua
4
api.lua
@ -9,7 +9,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20200916",
|
version = "20200923",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -637,7 +637,7 @@ function mob_class:do_stay_near()
|
|||||||
local searchnodes = self.stay_near[1]
|
local searchnodes = self.stay_near[1]
|
||||||
local chance = self.stay_near[2] or 10
|
local chance = self.stay_near[2] or 10
|
||||||
|
|
||||||
if random(chance) > 1 then
|
if not pos or random(chance) > 1 then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user