migrate game.item_prototypes for 2.0

This commit is contained in:
Zoryn
2024-10-22 11:14:26 -04:00
parent 22a396d46b
commit fef714c5db
3 changed files with 4 additions and 4 deletions

View File

@@ -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<string, int>
@@ -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)