From 8cfc6db0f4f4c4e29eb03d4e81aac9bf43958889 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sat, 13 Oct 2018 16:27:13 +0100 Subject: [PATCH] table.autokey still not working --- modules/ExpGamingLib/control.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ExpGamingLib/control.lua b/modules/ExpGamingLib/control.lua index 44f6cf69..5e8994ef 100644 --- a/modules/ExpGamingLib/control.lua +++ b/modules/ExpGamingLib/control.lua @@ -268,10 +268,10 @@ end -- @tparam table tbl the table that will be searched -- @tparam string str the string that will be looked for in the keys function table.autokey(tbl,str) + if not ExpLib.type_error(str,'string','Search string for table.autokey is not a string.') then return end local _return = {} for key,value in pairs(tbl) do - if ExpLib.is_type(key,'string') and string.contains(string.lower(key),string.lower(str)) then table.insert(_return,value) end - if not ExpLib.is_type(key,'string') then log(serpent.line(tbl)) end + if string.contains(string.lower(key),string.lower(str)) then table.insert(_return,value) end end return _return[1] or false end