From 4c4992f985c8d0cac8011c2e744eb658f1488fb5 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Mon, 17 May 2021 02:28:11 +0200 Subject: [PATCH] fixed bug in initial configuration --- functions.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/functions.lua b/functions.lua index 197ca18..cb5e433 100644 --- a/functions.lua +++ b/functions.lua @@ -2693,8 +2693,10 @@ yl_speak_up.input_talk = function(player, formname, fields) local dialog = yl_speak_up.speak_to[pname].dialog local d_id = yl_speak_up.speak_to[pname].d_id local count = 0 - for k,v in pairs(dialog) do - count = count + 1 + if(dialog and dialog.n_dialogs) then + for k,v in pairs(dialog.n_dialogs) do + count = count + 1 + end end -- give the NPC its first dialog if(not(dialog) or count==0) then