forked from your-land-mirror/yl_speak_up
fixed bug in ink import due to a wrong reimplementation of split command in test environment
This commit is contained in:
parent
40e7fc2087
commit
7e5fc745c0
@ -442,7 +442,7 @@ yl_speak_up.update_dialog_option = function(log, dialog, dialog_name, option_nam
|
|||||||
end
|
end
|
||||||
-- options for special dialogs have to start with "automaticly_"
|
-- options for special dialogs have to start with "automaticly_"
|
||||||
local parts = string.split(option_name or "", "_")
|
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], "_")
|
option_name = "automaticly_"..table.concat(parts[2], "_")
|
||||||
end
|
end
|
||||||
-- for d_trade and d_got_item effects and preconditions are created WITH DEFAULT VALUES TODO
|
-- 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
|
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).."\".")
|
table.insert(log, log_str.."FAILED to create unknown option \""..tostring(o_id).."\".")
|
||||||
return nil
|
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
|
-- we are asked to create a *new* option
|
||||||
o_id = nil
|
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
|
-- this option will be automaticly selected if its preconditions are true
|
||||||
mode = 1
|
mode = 1
|
||||||
option_name = parts[2]
|
option_name = parts[2]
|
||||||
o_id = option_name
|
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;
|
-- 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;
|
-- (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
|
-- 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
|
mode = 2
|
||||||
option_name = parts[2]
|
option_name = parts[2]
|
||||||
o_id = option_name
|
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).."\".")
|
table.insert(log, log_str.."FAILED to create unknown option \""..tostring(o_id).."\".")
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user