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

@@ -4,7 +4,7 @@ function save_crafts(event)
local crafting_queue = {}
-- Avoid overwriting old save
if global["saved_crafting_queue_"..player.name] ~= nil then
if global.inventory_sync.saved_crafting_queue[player.name] ~= nil then
player.print("You already have a saved crafting queue, restore it with /restore-crafts")
return
end
@@ -86,7 +86,7 @@ function save_crafts(event)
-- Remove extra inventory slots
player.character_inventory_slots_bonus = player.character_inventory_slots_bonus - 1000
global["saved_crafting_queue_"..player.name] = {
global.inventory_sync.saved_crafting_queue[player.name] = {
crafting_queue = crafting_queue,
ingredients = difference,
}