Factorio: fix certain recipes (like steel-plate) not getting their crafting time adjusted correctly.
This commit is contained in:
		
							parent
							
								
									54177c7064
								
							
						
					
					
						commit
						babd809fa6
					
				| 
						 | 
					@ -52,11 +52,19 @@ function copy_factorio_icon(tech, tech_source)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function adjust_energy(recipe_name, factor)
 | 
					function adjust_energy(recipe_name, factor)
 | 
				
			||||||
    local energy = data.raw.recipe[recipe_name].energy_required
 | 
					    local recipe = data.raw.recipe[recipe_name]
 | 
				
			||||||
    if (energy == nil) then
 | 
					    local energy = recipe.energy_required
 | 
				
			||||||
        energy = 1
 | 
					    if (energy ~= nil) then
 | 
				
			||||||
 | 
					        data.raw.recipe[recipe_name].energy_required = energy * factor
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if (recipe.normal ~= nil and recipe.normal.energy_required ~= nil) then
 | 
				
			||||||
 | 
					        energy = recipe.normal.energy_required
 | 
				
			||||||
 | 
					        recipe.normal.energy_required = energy * factor
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if (recipe.expensive ~= nil and recipe.expensive.energy_required ~= nil) then
 | 
				
			||||||
 | 
					        energy = recipe.expensive.energy_required
 | 
				
			||||||
 | 
					        recipe.expensive.energy_required = energy * factor
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    data.raw.recipe[recipe_name].energy_required = energy * factor
 | 
					 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
data.raw["assembling-machine"]["assembling-machine-1"].crafting_categories = table.deepcopy(data.raw["assembling-machine"]["assembling-machine-3"].crafting_categories)
 | 
					data.raw["assembling-machine"]["assembling-machine-1"].crafting_categories = table.deepcopy(data.raw["assembling-machine"]["assembling-machine-3"].crafting_categories)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue