Open main menu
Home
Random
Nearby
Log in
Settings
About Kancolle Wiki
Disclaimers
Kancolle Wiki
Search
Changes
← Older edit
Newer edit →
Module:Core
(view source)
Revision as of 09:30, 9 December 2017
211 bytes added
,
7 years ago
no edit summary
Line 181:
Line 181:
function Utils.requireModule(name)
function Utils.requireModule(name)
−
return
pcall(function () return require(string.format("Module:%s", name)) end)
+
local success, data =
pcall(function () return require(string.format("Module:%s", name)) end)
+
-- module without return (or empty, nil, false, true return) gives success = true, data = true
+
if data == true then
+
return false, nil
+
else
+
return success, data
+
end
end
end
がか
cssedit, gkautomate
7,064
edits