Add a warning about string nodenames abm values, they should not occur

This commit is contained in:
HybridDog 2019-11-04 12:16:08 +01:00
parent c3826283ea
commit f594c91ca3

View File

@ -1122,6 +1122,11 @@ local function get_grow(name)
local is = {} local is = {}
for i = 1,#minetest.registered_abms do for i = 1,#minetest.registered_abms do
local ad = minetest.registered_abms[i] local ad = minetest.registered_abms[i]
if type(ad.nodenames) ~= "table" then
minetest.log("warning", "ABM nodenames is not a table: " ..
dump(ad))
return
end
if ad.chance > 1 if ad.chance > 1
and table.indexof(ad.nodenames, name) ~= -1 then and table.indexof(ad.nodenames, name) ~= -1 then
is[#is+1] = ad.action is[#is+1] = ad.action