added yl_speak_up.check_if_dialog_has_option for easier check if option is available

This commit is contained in:
Sokomine 2023-10-01 20:18:51 +02:00
parent 4993656940
commit 2d2afdfb26

View File

@ -715,6 +715,17 @@ yl_speak_up.set_muted = function(p_name, obj, set_muted)
end
end
-- checks if dialog contains d_id and o_id
yl_speak_up.check_if_dialog_has_option = function(dialog, d_id, o_id)
return (dialog and d_id and o_id
and dialog.n_dialogs
and dialog.n_dialogs[d_id]
and dialog.n_dialogs[d_id].d_options
and dialog.n_dialogs[d_id].d_options[o_id])
end
-- has the player the right privs?
-- this is used for the "I am your master" talk based configuration; *NOT* for the staffs!
yl_speak_up.may_edit_npc = function(player, n_id)