diff --git a/cybersyn/scripts/factorio-api.lua b/cybersyn/scripts/factorio-api.lua index 77d0ac6..005fbfc 100644 --- a/cybersyn/scripts/factorio-api.lua +++ b/cybersyn/scripts/factorio-api.lua @@ -14,7 +14,7 @@ local DEFINES_LOW_POWER = defines.entity_status.low_power ---@param map_data MapData ---@param item_name string function get_stack_size(map_data, item_name) - return game.item_prototypes[item_name].stack_size + return prototypes.item[item_name].stack_size end ---@param item_order table @@ -756,7 +756,7 @@ function set_comb2(map_data, station) local signals = {} for item_name, count in pairs(deliveries) do local i = #signals + 1 - local is_fluid = game.item_prototypes[item_name] == nil--NOTE: this is expensive + local is_fluid = prototypes.item[item_name] == nil--NOTE: this is expensive signals[i] = {index = i, signal = {type = is_fluid and "fluid" or "item", name = item_name}, count = sign*count} end set_combinator_output(map_data, station.entity_comb2, signals) diff --git a/cybersyn/scripts/gui/main.lua b/cybersyn/scripts/gui/main.lua index 374dac8..5edcdb7 100644 --- a/cybersyn/scripts/gui/main.lua +++ b/cybersyn/scripts/gui/main.lua @@ -135,7 +135,7 @@ local function init_items(manager) manager.item_order = item_order local i = 1 - for _, protos in pairs{game.item_prototypes, game.fluid_prototypes} do + for _, protos in pairs{prototypes.item, game.fluid_prototypes} do --- @type (LuaItemPrototype|LuaFluidPrototype)[] local all_items = {} for _, proto in pairs(protos) do diff --git a/cybersyn/scripts/layout.lua b/cybersyn/scripts/layout.lua index cc01dc9..f7187e0 100644 --- a/cybersyn/scripts/layout.lua +++ b/cybersyn/scripts/layout.lua @@ -378,7 +378,7 @@ function set_refueler_combs(map_data, refueler, train) else name = a.name end - if game.item_prototypes[name] then + if prototypes.item[name] then wagon_signals[1] = {index = 1, signal = {type = "item", name = a.name}, count = 1} end end