fixed bug in ink import due to a wrong reimplementation of split command in test environment

This commit is contained in:
Sokomine 2025-01-09 23:19:09 +01:00
parent 40e7fc2087
commit 7e5fc745c0

View File

@ -442,7 +442,7 @@ yl_speak_up.update_dialog_option = function(log, dialog, dialog_name, option_nam
end
-- options for special dialogs have to start with "automaticly_"
local parts = string.split(option_name or "", "_")
if(not(parts) or not(parts[1]) or parts[1] ~= "automaticly_") then
if(not(parts) or not(parts[1]) or parts[1] ~= "automaticly") then
option_name = "automaticly_"..table.concat(parts[2], "_")
end
-- for d_trade and d_got_item effects and preconditions are created WITH DEFAULT VALUES TODO
@ -472,15 +472,15 @@ yl_speak_up.update_dialog_option = function(log, dialog, dialog_name, option_nam
if(not(parts) or not(parts[1]) or not(parts[2])) then
table.insert(log, log_str.."FAILED to create unknown option \""..tostring(o_id).."\".")
return nil
elseif(o_id and parts[1] == "new_") then
elseif(o_id and parts[1] == "new") then
-- we are asked to create a *new* option
o_id = nil
elseif(o_id and parts[1] == "automaticly_") then
elseif(o_id and parts[1] == "automaticly") then
-- this option will be automaticly selected if its preconditions are true
mode = 1
option_name = parts[2]
o_id = option_name
elseif(o_id and parts[1] == "randomly_") then
elseif(o_id and parts[1] == "randomly") then
-- this option will be randomly selected if its preconditions are true;
-- (that means all other options of this dialog will have to be randomly as well;
-- something which cannot be done here as there is no guarantee that all options
@ -488,7 +488,7 @@ yl_speak_up.update_dialog_option = function(log, dialog, dialog_name, option_nam
mode = 2
option_name = parts[2]
o_id = option_name
elseif(o_id and parts[1] ~= "o_") then
elseif(o_id and parts[1] ~= "o") then
table.insert(log, log_str.."FAILED to create unknown option \""..tostring(o_id).."\".")
return nil
end