From b604db1a233d41585673f7d100e8cfbb139fb124 Mon Sep 17 00:00:00 2001 From: Enrico Horn Date: Mon, 3 Jun 2019 00:21:46 +0200 Subject: [PATCH] findall: Fix the file export --- findall.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/findall.lua b/findall.lua index 2e72e20..f2942d8 100644 --- a/findall.lua +++ b/findall.lua @@ -456,10 +456,10 @@ function export_to_file(result, export) export_file:write('"char";"storage";"item";"quantity"\n') - for item_id, item_list in pairs(result) do - local names = get_item_names_by_id(item_id) - for char_name, storage_list in pairs(item_list) do - for storage_name, quantity in pairs(storage_list) do + for char_name, storage_list in pairs(result) do + for storage_name, item_list in pairs(storage_list) do + for item_id, quantity in pairs(item_list) do + local names = get_item_names_by_id(storage_name, item_id) export_file:write('"' .. char_name .. '";"' .. storage_name .. '";"' .. names.name .. '";"' .. quantity .. '"\n') end end