diff --git a/changelog.txt b/changelog.txt index 2bd2158..3f53792 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,11 @@ --------------------------------------------------------------------------------------------------- +Version: 0.15.4 +Date: 31. 10. 2023 + Scripting: + - Updated /static-libs + Bugfixes: + - Fixed type issues with EasyAPI during data:extend +--------------------------------------------------------------------------------------------------- Version: 0.15.3 Date: 31. 10. 2023 Scripting: diff --git a/experimental/lazyAPI.lua b/experimental/lazyAPI.lua index f09a3b3..e874825 100644 --- a/experimental/lazyAPI.lua +++ b/experimental/lazyAPI.lua @@ -397,6 +397,9 @@ lazyAPI.deleted_data = {} -- Deleted prototypes for key in pairs(data_raw) do lazyAPI.deleted_data[key] = {} end +lazyAPI.deleted_data.sound = lazyAPI.deleted_data.sound or {} +lazyAPI.deleted_data.animation = lazyAPI.deleted_data.animation or {} + ---@type table lazyAPI.prototypes_mod_source = {} @@ -1071,11 +1074,10 @@ data.extend = function(self, new_prototypes, ...) for k, prototype in pairs(new_prototypes) do if type(k) == "number" and type(prototype) == "table" and prototype.type then local _type = prototype.type - local name = prototype.name - if data_raw[_type] == nil then -- Fix for https://mods.factorio.com/mod/Better-TrainHorn - data_raw[_type] = {} - lazyAPI.deleted_data[_type] = lazyAPI.deleted_data[_type] or {} - end + local name = prototype.name + data_raw[_type] = data_raw[_type] or {} + lazyAPI.deleted_data[_type] = lazyAPI.deleted_data[_type] or {} + local prev_instance = data_raw[_type][name] -- Perhaps it should verify this case later instead if prev_instance and prev_instance ~= prototype then diff --git a/info.json b/info.json index d7f3aac..7128dba 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "zk-lib", - "version": "0.15.3", + "version": "0.15.4", "factorio_version": "1.1", "title": "ZwerOxotnik's extendable mod with 8 addons", "author": "ZwerOxotnik", diff --git a/static-libs b/static-libs index 5a2edfc..daec7b6 160000 --- a/static-libs +++ b/static-libs @@ -1 +1 @@ -Subproject commit 5a2edfc13e88616a7159583e9782de307ae17563 +Subproject commit daec7b6669ea02565e312dec2dc6ff328e1456ca