mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-18 14:29:32 +01:00
Fix sign crashes
This commit is contained in:
parent
9d53398045
commit
2b2e73bf98
1 changed files with 4 additions and 1 deletions
|
@ -153,11 +153,14 @@ local update_sign = function(pos, fields, sender)
|
||||||
end
|
end
|
||||||
local owner = meta:get_string("owner")
|
local owner = meta:get_string("owner")
|
||||||
local text = meta:get_string("text")
|
local text = meta:get_string("text")
|
||||||
if fields and sender:get_player_name() == owner or text == "" and fields then
|
if fields and (sender:get_player_name() == owner or (text == "" and fields.text)) then
|
||||||
meta:set_string("text", fields.text)
|
meta:set_string("text", fields.text)
|
||||||
text = fields.text
|
text = fields.text
|
||||||
meta:set_string("owner", sender:get_player_name() or "")
|
meta:set_string("owner", sender:get_player_name() or "")
|
||||||
end
|
end
|
||||||
|
if text == nil then
|
||||||
|
text = ""
|
||||||
|
end
|
||||||
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
|
if v:get_entity_name() == "signs:text" then
|
||||||
|
|
Loading…
Reference in a new issue