mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-01-11 02:10:20 +01: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 = {
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user