add check and log warning for tmp_mob_name nil value
parent
9732e950eb
commit
232865e09b
|
@ -320,6 +320,7 @@ function spawners_mobs.on_timer(pos, elapsed)
|
||||||
object:get_luaentity().name ~= "__builtin:item" then
|
object:get_luaentity().name ~= "__builtin:item" then
|
||||||
local tmp_mob_name = string.split(object:get_luaentity().name, ":")[2]
|
local tmp_mob_name = string.split(object:get_luaentity().name, ":")[2]
|
||||||
|
|
||||||
|
if tmp_mob_name ~= nil then
|
||||||
-- sheeps have colors in names
|
-- sheeps have colors in names
|
||||||
if string.find(tmp_mob_name, "sheep") and string.find(mob_name, "sheep") and not string.find(tmp_mob_name, "dummy") then
|
if string.find(tmp_mob_name, "sheep") and string.find(mob_name, "sheep") and not string.find(tmp_mob_name, "dummy") then
|
||||||
-- print("found entity: "..tmp_mob_name)
|
-- print("found entity: "..tmp_mob_name)
|
||||||
|
@ -329,6 +330,9 @@ function spawners_mobs.on_timer(pos, elapsed)
|
||||||
-- print("found entity: "..tmp_mob_name)
|
-- print("found entity: "..tmp_mob_name)
|
||||||
entities_near = entities_near + 1
|
entities_near = entities_near + 1
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
minetest.log("warning", "[spawners_mobs] tmp_mob_name was nil, luaentity name was: "..object:get_luaentity().name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- stop looping when met all conditions
|
-- stop looping when met all conditions
|
||||||
|
|
Loading…
Reference in New Issue