nil check for do_stay_near

This commit is contained in:
TenPlus1 2020-09-23 20:35:04 +01:00
parent b6fb1948e8
commit f14050ad3c
1 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@ local use_cmi = minetest.global_exists("cmi")
mobs = {
mod = "redo",
version = "20200916",
version = "20200923",
intllib = S,
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 chance = self.stay_near[2] or 10
if random(chance) > 1 then
if not pos or random(chance) > 1 then
return false
end