ignore leading/tailing whitespaces when checking password

This commit is contained in:
Sokomine 2021-06-20 17:53:39 +02:00
parent 827020d167
commit cea602230f

View File

@ -565,8 +565,9 @@ yl_speak_up.input_fs_action_text_input = function(player, formname, fields)
end
if(fields.finished_action and fields.quest_answer and fields.quest_answer ~= "") then
-- is the answer correct?
-- TODO: strip leading and tailing blanks?
local success = not(not(fields.quest_answer and fields.quest_answer == a.a_value))
-- strip leading and tailing blanks
local success = not(not(fields.quest_answer and a.a_value
and fields.quest_answer:trim() == a.a_value:trim()))
-- the action was a either a success or failure
yl_speak_up.execute_next_action(player, a_id, success)
return