From f2bba9b270d842f4400912ef042d314451b46474 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Fri, 2 Jul 2021 02:35:22 +0200 Subject: [PATCH] removed surplus checks for empty data --- fs_edit_general.lua | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/fs_edit_general.lua b/fs_edit_general.lua index 2a8bf48..7f15a4c 100644 --- a/fs_edit_general.lua +++ b/fs_edit_general.lua @@ -1548,9 +1548,6 @@ end yl_speak_up.get_fs_edit_option_effect_chat_all = function(pname, dialog, formspec, data, id_prefix, save_button) local default_text = "$NPC_NAME$ (owned by $OWNER_NAME$) announces: $PLAYER_NAME$ ".. "- example; please enter the text -" - if(not(data)) then - data = {} - end return "label[0.2,3.3;Send the following chat message to *all* players:]".. "label[0.2,4.1;Message:]".. @@ -1603,9 +1600,6 @@ end elseif(data.what and id_prefix == "a_" and data.what == 4) then yl_speak_up.get_fs_edit_option_action_npc_gives = function(pname, dialog, formspec, data, id_prefix, save_button) - if(not(data)) then - data = {} - end local bg_img = "" if(data and data.item_string) then bg_img = "item_image[2.15,3.65;0.7,0.7;"..tostring(data.item_string).."]" @@ -1657,9 +1651,6 @@ end elseif(data.what and id_prefix == "a_" and data.what == 5) then yl_speak_up.get_fs_edit_option_action_npc_wants = function(pname, dialog, formspec, data, id_prefix, save_button) - if(not(data)) then - data = {} - end local bg_img = "" if(data and data.item_string) then bg_img = "item_image[2.15,3.65;0.7,0.7;"..tostring(data.item_string).."]" @@ -1698,9 +1689,6 @@ end elseif(data.what and id_prefix == "a_" and data.what == 6) then yl_speak_up.get_fs_edit_option_action_text_input = function(pname, dialog, formspec, data, id_prefix, save_button) - if(not(data)) then - data = {} - end return "label[0.2,3.3;What to ask the player and which answer to expect:]".. "label[0.2,4.0;Question to show:]".. @@ -1740,9 +1728,6 @@ end or (id_prefix == "r_" and data.what == 11))) then yl_speak_up.get_fs_edit_option_action_custom = function(pname, dialog, formspec, data, id_prefix, save_button) - if(not(data)) then - data = {} - end formspec = formspec.. "label[0.2,3.3;Note: Calling a custom function will require direct support ".. "from the server.]"..