Files
factorio-clusterio/plugins/inventory_sync/module/restore_crafts.lua
T

20 lines
547 B
Lua

local load_crafting_queue = require("modules/inventory_sync/load_crafting_queue")
function restore_crafts(event)
if event.player_index then
local player = game.players[event.player_index]
local crafting_queue = global["saved_crafting_queue_"..player.name]
if crafting_queue == nil then
player.print("No saved crafting queue")
return
end
load_crafting_queue(crafting_queue, player)
global["saved_crafting_queue_"..player.name] = nil
end
end
return restore_crafts