-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost.lua
More file actions
25 lines (22 loc) · 824 Bytes
/
post.lua
File metadata and controls
25 lines (22 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
local api = dofile_once("data/scripts/lua_mods/api.lua")
for _, v in ipairs(LUA_MODLOADER_LOADED_MODS) do
if v.callbacks.post ~= nil then
local success, err = pcall(v.callbacks.post, api, v.config)
if not success then
table.insert(LUA_MODLOADER_ERRORS, "Error running prehook for mod " .. v.name .. " got an error: " .. err)
end
end
end
local num_errors = #LUA_MODLOADER_ERRORS
if num_errors ~= 0 then
api.log("\n\n" .. num_errors .. " ERRORS LOADING MODS:\n\n")
for _, v in ipairs(LUA_MODLOADER_ERRORS) do
api.log(v .. "\n")
end
api.log("\nYOU NEED TO FIX THESE\n\n")
local old_creature_list = creature_list -- game printing is only available in these later callbacks
function creature_list(...)
game_print(num_errors .. " Errors occured when loading mods")
return old_creature_list(...)
end
end