Support for transferring crafting queues

This commit is contained in:
Daniel committed 2021-07-12 22:05:54 +02:00
1 parent 40301f59b7
commit 87218e4803
8 files changed
+339 -182

No files matched your search

@@ -0,0 +1,19 @@
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