https://cdn.discordapp.com/attachments/ ... 0.1.10.zip
1. Download ZIP above and put it in the mods folder
2. Disable all other mods
3. Start a new game
4. Open the game menu and click the "Restart" button
Results: The game freezes completely.
Now, the interesting code is on line 1 of control.lua:
Code: Select all
local ev = require("lib-events")
So, a logical conclusion seems to be that it must be the code in lib-events.lua that is problematic. So here it is;
Code: Select all
local MAJOR, MINOR, register = "lib-events", 1, true
local eventIds
if remote.interfaces[MAJOR] then
local existingIds = remote.call(MAJOR, "getEventIds")
if type(existingIds) ~= "nil" then eventIds = existingIds
else error("Previous version of lib-events did not pass on the registered event IDs.") end
local version = remote.call(MAJOR, "version")
if type(version) == "number" and version <= MINOR then register = false
else
remote.remove_interface(MAJOR)
print("More recent version of lib-events has been detected.")
end
end
if register then
if type(eventIds) ~= "table" then eventIds = {} end
local function getId(name)
if not eventIds[name] then eventIds[name] = script.generate_event_name() end
return eventIds[name]
end
local function trigger(name, ...)
if not eventIds[name] then return end
script.raise_event(eventIds[name], {...})
end
remote.add_interface(MAJOR, {
getId=getId,
trigger=trigger,
version=function() return MINOR end,
getEventIds=function() return eventIds end,
})
end
local m = {
trigger = function(...) remote.call(MAJOR, "trigger", ...) end,
register = function(name, funcref)
script.on_event((remote.call(MAJOR, "getId", name)), funcref)
end,
}
return m