fixed undeclared use of global vars

This commit is contained in:
Sokomine 2022-04-12 03:48:08 +02:00
parent b012d4e251
commit ccfffc9568
3 changed files with 7 additions and 7 deletions

View File

@ -392,7 +392,7 @@ yl_speak_up.get_fs_talkdialog = function(player, n_id, d_id, alternate_text, rec
local pname_for_old_fs = yl_speak_up.get_pname_for_old_fs(pname)
local fs_version = yl_speak_up.fs_version[pname]
formspec = {}
local formspec = {}
local h
-- this is used to build a list of all available dialogs for a dropdown menu in edit mode

View File

@ -86,7 +86,7 @@ end)
-- show formspec with highest possible version information for the player
-- force_version: optional parameter
yl_speak_up.show_fs_ver = function(pname, formname, formspec, force_version)
fs_ver = (yl_speak_up.fs_version[pname] or "2")
local fs_ver = (yl_speak_up.fs_version[pname] or "2")
if(force_version) then
fs_ver = force_version
end

View File

@ -92,7 +92,7 @@ yl_speak_up.get_fs_trade_list = function(player, show_dialog_option_trades)
local pname_for_old_fs = yl_speak_up.get_pname_for_old_fs(pname)
local formspec = {}
h = -0.8
local h = -0.8
-- arrange the offers in yl_speak_up.trade_max_cols columns horizontally
-- and yl_speak_up.trade_max_rows row vertically
@ -109,7 +109,7 @@ yl_speak_up.get_fs_trade_list = function(player, show_dialog_option_trades)
table.sort(sorted_trades)
for i, k in ipairs(sorted_trades) do
v = dialog.trades[ k ]
local v = dialog.trades[ k ]
-- needs both to be negated because show_dialog_option_trades will most of the time be nil
-- and the actual value of v.d_id isn't of intrest here either
if( (not(show_dialog_option_trades) == not(v.d_id))
@ -168,14 +168,14 @@ yl_speak_up.get_fs_trade_list = function(player, show_dialog_option_trades)
-- and those normal ones in the trade list
if(yl_speak_up.may_edit_npc(player, n_id)) then
if(not(show_dialog_option_trades)) then
text = "This is the trade list view (player view). "..
local text = "This is the trade list view (player view). "..
"Show trades attached to dialog options."
h = yl_speak_up.add_edit_button_fs_talkdialog(formspec, h,
"show_dialog_option_trades",
text, text,
true, nil, nil, pname_for_old_fs)
else
text = "These are trades attached to dialog options. "..
local text = "These are trades attached to dialog options. "..
"Show trade list trades (player view)."
h = yl_speak_up.add_edit_button_fs_talkdialog(formspec, h,
"show_trade_list",
@ -183,7 +183,7 @@ yl_speak_up.get_fs_trade_list = function(player, show_dialog_option_trades)
true, nil, nil, pname_for_old_fs)
end
-- button "add trade" for those who can edit the NPC (entering edit mode is not required)
text = "Add a new trade."
local text = "Add a new trade."
h = yl_speak_up.add_edit_button_fs_talkdialog(formspec, h,
"trade_list_add_trade",
text, text,