forked from mtcontrib/homedecor_modpack
fix crash?
This commit is contained in:
parent
432b4046e1
commit
2bb1eadc9e
@ -339,6 +339,7 @@ homedecor.update_sign = function(pos, fields)
|
|||||||
meta:set_string("text", fields.text)
|
meta:set_string("text", fields.text)
|
||||||
end
|
end
|
||||||
local text = meta:get_string("text")
|
local text = meta:get_string("text")
|
||||||
|
if text == nil then return
|
||||||
local objects = minetest.get_objects_inside_radius(pos, 0.5)
|
local objects = minetest.get_objects_inside_radius(pos, 0.5)
|
||||||
for _, v in ipairs(objects) do
|
for _, v in ipairs(objects) do
|
||||||
local e = v:get_luaentity()
|
local e = v:get_luaentity()
|
||||||
@ -556,8 +557,10 @@ if not homedecor.disable_signs then
|
|||||||
signs_text_on_activate = function(self)
|
signs_text_on_activate = function(self)
|
||||||
local meta = minetest.get_meta(self.object:getpos())
|
local meta = minetest.get_meta(self.object:getpos())
|
||||||
local text = meta:get_string("text")
|
local text = meta:get_string("text")
|
||||||
|
if text then
|
||||||
set_obj_text(self.object, text)
|
set_obj_text(self.object, text)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
else
|
else
|
||||||
signs_text_on_activate = function(self)
|
signs_text_on_activate = function(self)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
|
Loading…
Reference in New Issue
Block a user