From a939e11641b8d29275f3e7108c95def10482af81 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 11 Jun 2021 15:56:49 +0200 Subject: [PATCH] Fixed bug with import of logistics slots Slots were shifted 1 slot to the right every time due to off by one issue in the deserializer --- plugins/inventory_sync/module/download_inventory.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/inventory_sync/module/download_inventory.lua b/plugins/inventory_sync/module/download_inventory.lua index 0110a0af..e8c511b3 100644 --- a/plugins/inventory_sync/module/download_inventory.lua +++ b/plugins/inventory_sync/module/download_inventory.lua @@ -42,7 +42,7 @@ function download_inventory(playerName, data, number, total) -- Load personal logistics slots for i = 1, 200 do - local slot = serialized_player.personal_logistic_slots[tostring(i)] + local slot = serialized_player.personal_logistic_slots[tostring(i+1)] -- 1 is empty to force array to be spare if slot ~= nil then player.set_personal_logistic_slot(i, slot) end @@ -88,7 +88,9 @@ function download_inventory(playerName, data, number, total) end local startTick = global["inv_sync_download_start_tick "..game.players[playerName].name] - game.print("Imported inventory for "..playerName.." in "..game.tick - startTick.." ticks") + local log_line = "Imported inventory for "..playerName.." in "..game.tick - startTick.." ticks" + player.print(log_line) + log("[inventory_sync] "..log_line) end end