diff --git a/PHI-CL/data-updates.lua b/PHI-CL/data-updates.lua index 5213081..443aa05 100644 --- a/PHI-CL/data-updates.lua +++ b/PHI-CL/data-updates.lua @@ -483,6 +483,51 @@ if settings.startup['PHI-XW-WATER'].value > 0 then end end +if settings.startup['PHI-CT'].value and settings.startup['PHI-CT-OIL'].value then + local item = table.deepcopy(data.raw['item']['offshore-pump']) + + item.name = 'oil-pump' + item.place_result = 'oil-pump' + item.order = 'b[fluids]-a[offshore-pump]-o' + + item.icons = { + { + icon = '__base__/graphics/icons/offshore-pump.png', + tint = items['tint'][2], + icon_size = 64, + icon_mipmaps = 4 + } + } + + item.icon = nil + item.icon_size = nil + item.icon_mipmaps = nil + item.localised_name = {'name.oil-pump'} + item.localised_description = {'description.oil-pump'} + data:extend({item}) + + local entity = table.deepcopy(data.raw['offshore-pump']['offshore-pump']) + entity.name = 'oil-pump' + entity.minable.result = 'oil-pump' + entity.fluid = 'crude-oil' + entity.fluid_box.filter = 'crude-oil' + entity.se_allow_in_space = true + entity.localised_name = {'name.oil-pump'} + entity.localised_description = {'description.oil-pump'} + data:extend({entity}) + + data:extend({{ + type = 'recipe', + name = 'oil-pump', + energy_required = 2, + enabled = true, + ingredients = {{'electronic-circuit', 2}, {'pipe', 1}, {'iron-gear-wheel', 1}}, + result = 'oil-pump', + localised_name = {'name.oil-pump'}, + localised_description = {'description.oil-pump'} + }}) +end + for _, v in pairs(items['item']) do if (v.stage == file_stage) and v.enabled and (v.max >= v.min) then v.category = 'item' diff --git a/PHI-CL/data.lua b/PHI-CL/data.lua index 8c33b33..bee85ad 100644 --- a/PHI-CL/data.lua +++ b/PHI-CL/data.lua @@ -50,50 +50,6 @@ if settings.startup['PHI-EN'].value and settings.startup['PHI-EN-SOLAR-TIER'].va end end -if settings.startup['PHI-CT'].value and settings.startup['PHI-CT-OIL'].value then - local item = table.deepcopy(data.raw['item']['offshore-pump']) - item.name = 'oil-pump' - item.place_result = 'oil-pump' - item.order = 'b[fluids]-a[offshore-pump]-o' - - item.icons = { - { - icon = '__base__/graphics/icons/offshore-pump.png', - tint = items['tint'][2], - icon_size = 64, - icon_mipmaps = 4 - } - } - - item.icon = nil - item.icon_size = nil - item.icon_mipmaps = nil - item.localised_name = {'name.oil-pump'} - item.localised_description = {'description.oil-pump'} - data:extend({item}) - - local entity = table.deepcopy(data.raw['offshore-pump']['offshore-pump']) - entity.name = 'oil-pump' - entity.minable.result = 'oil-pump' - entity.fluid = 'crude-oil' - entity.fluid_box.filter = 'crude-oil' - entity.se_allow_in_space = true - entity.localised_name = {'name.oil-pump'} - entity.localised_description = {'description.oil-pump'} - data:extend({entity}) - - data:extend({{ - type = 'recipe', - name = 'oil-pump', - energy_required = 2, - enabled = true, - ingredients = {{'electronic-circuit', 2}, {'pipe', 1}, {'iron-gear-wheel', 1}}, - result = 'oil-pump', - localised_name = {'name.oil-pump'}, - localised_description = {'description.oil-pump'} - }}) -end - if settings.startup['PHI-CT'].value and settings.startup['PHI-CT-RADAR'].value then local item = table.deepcopy(data.raw['item']['radar']) item.name = 'super-radar' diff --git a/PHI-CL/main.lua b/PHI-CL/main.lua index 12d2ea3..a6798b9 100644 --- a/PHI-CL/main.lua +++ b/PHI-CL/main.lua @@ -48,6 +48,10 @@ end function main.EEE(source, tier) local item = table.deepcopy(data.raw[source.type][source.ref_name]) + if not (item or item.name) then + assert('ERROR - trying to load ' .. source.type .. ' / ' .. source.ref_name) + end + item.name = source.name .. '-' .. tier item.minable.result = item.name item.max_health = item.max_health * (tier - source.min + 2)