diff --git a/PHI-CL/data/b/gm-vp.lua b/PHI-CL/data/b/gm-vp.lua index f96629e..8de1950 100644 --- a/PHI-CL/data/b/gm-vp.lua +++ b/PHI-CL/data/b/gm-vp.lua @@ -169,7 +169,7 @@ for _, v in pairs({'processing-unit-productivity', 'steel-plate-productivity', ' end -- GM-VP C 1 SPACE_AGE RESEARCH -if data.raw.technology['research-productivity'] then +if data.raw.technology['research-productivity'] and data.raw.technology['research-productivity'].unit then data.raw.technology['research-productivity'].unit.count_formula = '1500 * (1.5 ^ L)' data.raw.technology['research-productivity'].unit.ingredients = {{'automation-science-pack', 1}, {'logistic-science-pack', 1}, {'military-science-pack', 1}, {'chemical-science-pack', 1}, {'production-science-pack', 1}, {'utility-science-pack', 1}, {'space-science-pack', 1}} end @@ -180,8 +180,10 @@ if data.raw.technology['automation'] and data.raw.technology['automation'].effec end -- GM-VP A 2 SPACE_AGE RESEARCH_EFFECT -table.insert(data.raw.technology['fusion-reactor'].effects, {type = 'unlock-recipe', recipe = 'fluoroketone'}) -table.insert(data.raw.technology['fusion-reactor'].effects, {type = 'unlock-recipe', recipe = 'fluoroketone-cooling'}) +if data.raw.technology['fusion-reactor'] and data.raw.technology['fusion-reactor'].effects then + table.insert(data.raw.technology['fusion-reactor'].effects, {type = 'unlock-recipe', recipe = 'fluoroketone'}) + table.insert(data.raw.technology['fusion-reactor'].effects, {type = 'unlock-recipe', recipe = 'fluoroketone-cooling'}) +end -- GM-VP C 1 BASE RESEARCH -- GM-VP C 6 SPACE_AGE RESEARCH @@ -193,8 +195,10 @@ end -- GM-VP C 1 BASE ENTITY -- GM-VP C 1 SPACE_AGE ENTITY -for _, v in pairs(data.raw.lab) do - v.inputs = {'automation-science-pack', 'logistic-science-pack', 'military-science-pack', 'chemical-science-pack', 'production-science-pack', 'utility-science-pack', 'space-science-pack'} +if data.raw['lab'] then + for _, v in pairs(data.raw['lab']) do + v.inputs = {'automation-science-pack', 'logistic-science-pack', 'military-science-pack', 'chemical-science-pack', 'production-science-pack', 'utility-science-pack', 'space-science-pack'} + end end -- GM-VP C 2 BASE ENTITY diff --git a/PHI-CL/data/b/gm.lua b/PHI-CL/data/b/gm.lua index 0534127..e74c617 100644 --- a/PHI-CL/data/b/gm.lua +++ b/PHI-CL/data/b/gm.lua @@ -126,8 +126,10 @@ for _, v in pairs({'artillery-shell-damage-1', 'railgun-damage-1', 'railgun-shoo end -- GM H 1 SPACE_AGE TOOL -data.raw.tool['promethium-science-pack'].hidden = true -data.raw.tool['promethium-science-pack'].hidden_in_factoriopedia = true +if data.raw.tool['promethium-science-pack'] then + data.raw.tool['promethium-science-pack'].hidden = true + data.raw.tool['promethium-science-pack'].hidden_in_factoriopedia = true +end -- GM C 5 BASE RESOURCE -- GM C 3 SPACE_AGE RESOURCE @@ -195,9 +197,11 @@ if data.raw.item['depleted-uranium-fuel-cell'] and data.raw.item['nuclear-fuel'] localised_description = {'description.charged-train-battery'} }}) - for _, v in pairs(data.raw['locomotive']) do - if v.energy_source then - v.energy_source.burnt_inventory_size = (v.energy_source.burnt_inventory_size and math.max(v.energy_source.burnt_inventory_size, 1)) or 1 + if data.raw['locomotive'] then + for _, v in pairs(data.raw['locomotive']) do + if v.energy_source then + v.energy_source.burnt_inventory_size = (v.energy_source.burnt_inventory_size and math.max(v.energy_source.burnt_inventory_size, 1)) or 1 + end end end end diff --git a/PHI-CL/data/b/mi.lua b/PHI-CL/data/b/mi.lua index 3460ca2..386052c 100644 --- a/PHI-CL/data/b/mi.lua +++ b/PHI-CL/data/b/mi.lua @@ -5,12 +5,14 @@ if settings.startup['PHI-MI-PIPE'].value then end -- MI C 2 BASE ENTITY -for _, t in pairs({data.raw['construction-robot'], data.raw['logistic-robot']}) do - for _, v in pairs(t) do - if settings.startup['PHI-MI-ROBOT-ENERGY'].value then - v.energy_per_tick = (v.energy_per_tick and '0J') or nil - v.energy_per_move = (v.energy_per_move and '0J') or nil - v.speed_multiplier_when_out_of_energy = (v.speed_multiplier_when_out_of_energy and 1) or nil +for _, t in pairs({'construction-robot', 'logistic-robot'}) do + if data.raw[t] then + for _, v in pairs(data.raw[t]) do + if settings.startup['PHI-MI-ROBOT-ENERGY'].value then + v.energy_per_tick = (v.energy_per_tick and '0J') or nil + v.energy_per_move = (v.energy_per_move and '0J') or nil + v.speed_multiplier_when_out_of_energy = (v.speed_multiplier_when_out_of_energy and 1) or nil + end end end end diff --git a/PHI-CL/data/u/mi.lua b/PHI-CL/data/u/mi.lua index 110e4bb..f4c3879 100644 --- a/PHI-CL/data/u/mi.lua +++ b/PHI-CL/data/u/mi.lua @@ -11,7 +11,7 @@ local mod_tint = { -- MIGS A 1 BASE ENTITY,ITEM,RECIPE -- MIGS A 9 BASE VIRTUAL_SIGNAL -- MIGS A 15 SPACE_AGE VIRTUAL_SIGNAL -if data.raw['constant-combinator']['constant-combinator'] then +if data.raw['constant-combinator'] and data.raw['constant-combinator']['constant-combinator'] then local item = table.deepcopy(data.raw['item']['constant-combinator']) item.name = 'super-combinator' item.place_result = item.name