diff --git a/fs_npc_list.lua b/fs_npc_list.lua index 48797e6..484412d 100644 --- a/fs_npc_list.lua +++ b/fs_npc_list.lua @@ -272,6 +272,12 @@ yl_speak_up.build_cache_general_npc_list_lines = function() priv_list = priv_list..tostring(short_priv_name[priv])..' ' end end + -- fallback if something went wrong with the position (or it's unknown) + local pos_str = '- unknown -' + if(not(data.pos) or not(data.pos.x) or not(data.pos.y) or not(data.pos.z)) then + pos = {x=0, y=0, z=0} + end + pos_str = minetest.formspec_escape(minetest.pos_to_string(data.pos)) yl_speak_up.cache_general_npc_list_lines[k] = { id = k, -- keep for sorting @@ -286,7 +292,7 @@ yl_speak_up.build_cache_general_npc_list_lines = function() anz_trades = show_if_bigger_null(#data.trades), anz_properties = show_if_bigger_null(data.properties, true), anz_editors = show_if_bigger_null(data.may_edit, true), - pos = minetest.formspec_escape(minetest.pos_to_string(data.pos)), + pos = pos_str, priv_list = priv_list, } end