I got really annoyed and changed the control.lua file to stop the error.
I also just noticed it on a multiplayer game map that I was following (someone else in that game probably used FARL). Trouble is that if you "fix" the mod then you cannot return to the multiplayer game because your version of the mods are not the same as everyone else. I guess that if you are hosting then you could make coding change, load map and then save it. Error should stop. Then restore the original zip file and rehost. Ask players not to use FARL.
It is a brute force solution. Never used this language before so probably did not do it properly. At the start of the function call I test for nil value in the parameter and if nil then calls the FARL reset functions.
(slightly before line 151 where the error occurs - I added 7 lines of code including the start/end comments)
local function on_tick(event)
local status, err = pcall(function()
-- if event.tick % 10 == 8 then
-- global.player_opened = global.player_opened or {}
-- for _, player in pairs(game.connected_players) do
-- if player.opened ~= nil and player.opened.type == "locomotive" and not global.player_opened[player.index] then
-- on_player_opened(player.opened, player)
-- global.player_opened[player.index] = player.opened
-- end
-- if global.player_opened[player.index] and player.opened == nil then
-- on_player_closed(global.player_opened[player.index], player)
-- global.player_opened[player.index] = nil
-- end
-- end
-- end
<pre>
-- >>> Tony3D i added
if event == nil then
if farl and farl.active then
farl:deactivate("Unexpected error: "..err)
end
end
-- <<< Tony3D end of add
if global.overlayStack and global.overlayStack[event.tick] then
for _, overlay in pairs(global.overlayStack[event.tick]) do
if overlay.valid then
overlay.destroy()
end
end
global.overlayStack[event.tick] = nil
end
</pre>