Changed usage of globals, worked around edge cases

This commit is contained in:
danielv authored and Daniel committed 2021-07-12 22:05:54 +02:00
1 parent f9ef2ebbe1
commit 98f801e244
11 files changed
+124 -62

No files matched your search

@@ -3,7 +3,7 @@ local load_crafting_queue = require("modules/inventory_sync/load_crafting_queue"
function restore_crafts(event)
if event.player_index then
local player = game.get_player(event.player_index)
local crafting_queue = global["saved_crafting_queue_"..player.name]
local crafting_queue = global.inventory_sync.saved_crafting_queue[player.name]
if crafting_queue == nil then
player.print("No saved crafting queue")
@@ -12,7 +12,7 @@ function restore_crafts(event)
load_crafting_queue(crafting_queue, player)
global["saved_crafting_queue_"..player.name] = nil
global.inventory_sync.saved_crafting_queue[player.name] = nil
end
end