add check and log warning for tmp_mob_name nil value
This commit is contained in:
parent
9732e950eb
commit
232865e09b
@ -320,14 +320,18 @@ 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]
|
||||||
|
|
||||||
-- sheeps have colors in names
|
if tmp_mob_name ~= nil then
|
||||||
if string.find(tmp_mob_name, "sheep") and string.find(mob_name, "sheep") and not string.find(tmp_mob_name, "dummy") then
|
-- sheeps have colors in names
|
||||||
-- print("found entity: "..tmp_mob_name)
|
if string.find(tmp_mob_name, "sheep") and string.find(mob_name, "sheep") and not string.find(tmp_mob_name, "dummy") then
|
||||||
entities_near = entities_near + 1
|
-- print("found entity: "..tmp_mob_name)
|
||||||
|
entities_near = entities_near + 1
|
||||||
elseif tmp_mob_name == mob_name then
|
|
||||||
-- print("found entity: "..tmp_mob_name)
|
elseif tmp_mob_name == mob_name then
|
||||||
entities_near = entities_near + 1
|
-- print("found entity: "..tmp_mob_name)
|
||||||
|
entities_near = entities_near + 1
|
||||||
|
end
|
||||||
|
else
|
||||||
|
minetest.log("warning", "[spawners_mobs] tmp_mob_name was nil, luaentity name was: "..object:get_luaentity().name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user