forked from minetest-mods/mesecons
Fix crash if metarule not found
This commit is contained in:
parent
ae557d1cd4
commit
b3f3692622
@ -91,7 +91,13 @@ end
|
|||||||
|
|
||||||
function mesecon:rule2meta(findrule, allrules)
|
function mesecon:rule2meta(findrule, allrules)
|
||||||
local index = mesecon:rule2metaindex(findrule, allrules)
|
local index = mesecon:rule2metaindex(findrule, allrules)
|
||||||
if index == nil then return allrules end
|
if index == nil then
|
||||||
|
if allrules[1].x then
|
||||||
|
return allrules
|
||||||
|
else
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
end
|
||||||
return allrules[index]
|
return allrules[index]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user