Remove reference to deprecated method `get_entity_name'.

This commit is contained in:
kaeza 2013-10-25 17:22:14 -02:00
parent 3e6fb4a911
commit 39655c4f5d

View File

@ -328,7 +328,8 @@ end
homedecor.destruct_sign = function(pos) homedecor.destruct_sign = function(pos)
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
if v:get_entity_name() == "signs:text" then local e = v:get_luaentity()
if e and e.name == "signs:text" then
v:remove() v:remove()
end end
end end
@ -352,7 +353,8 @@ homedecor.update_sign = function(pos, fields)
local text = meta:get_string("text") local text = meta:get_string("text")
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
if v:get_entity_name() == "signs:text" then local e = v:get_luaentity()
if e and e.name == "signs:text" then
set_obj_text(v, text) set_obj_text(v, text)
return return
end end