From 3c03dbfbfecc73fa956df110e435f15b00e168af Mon Sep 17 00:00:00 2001 From: ILLISIS Date: Thu, 14 Nov 2024 00:25:21 +1100 Subject: [PATCH] v2.0.12 --- changelog.txt | 5 +++++ info.json | 2 +- script/entity_processor.lua | 5 ++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index 9dfbb17..2a19830 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 2.0.12 +Date: ???? + Bugfixes: + - Fixed a crash when performing a quality upgrade on an entity with a mismatching item name. +--------------------------------------------------------------------------------------------------- Version: 2.0.11 Date: 2024-11-10 Changes: diff --git a/info.json b/info.json index 94b1fd8..6b90d2d 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "Constructron-Continued", - "version": "2.0.11", + "version": "2.0.12", "title": "Constructron-Continued", "author": "ILLISIS", "homepage": "https://github.com/ILLISIS/Constructron-continued/", diff --git a/script/entity_processor.lua b/script/entity_processor.lua index b7688bb..b9dbd9f 100644 --- a/script/entity_processor.lua +++ b/script/entity_processor.lua @@ -584,13 +584,12 @@ entity_proc.upgrade = function(entity) ---@cast quality -nil local target_quality_level = quality.name local current_quality_level = entity.quality.name - local old_entity_name = entity.name local items_to_place_cache = storage.items_to_place_cache[target_entity.name] local item_name = items_to_place_cache.item required_items[item_name] = required_items[item_name] or {} required_items[item_name][target_quality_level] = (required_items[item_name][target_quality_level] or 0) + items_to_place_cache.count - trash_items[old_entity_name] = trash_items[old_entity_name] or {} - trash_items[old_entity_name][current_quality_level] = (trash_items[old_entity_name][current_quality_level] or 0) + 1 + trash_items[item_name] = trash_items[item_name] or {} + trash_items[item_name][current_quality_level] = (trash_items[item_name][current_quality_level] or 0) + 1 return required_items, trash_items end