forked from cacklingfiend/lignumis
		
	generator-equipment uses wood as fuel
This commit is contained in:
		
							parent
							
								
									2de7af444b
								
							
						
					
					
						commit
						0c064f7a00
					
				
					 1 changed files with 10 additions and 7 deletions
				
			
		|  | @ -16,13 +16,15 @@ local blacklist = {} | |||
| 
 | ||||
| function update_fuel_categories(t) | ||||
|     for _, entity in pairs(t) do | ||||
|         if entity.energy_source | ||||
|             and entity.energy_source.type == "burner" | ||||
|         for _, energy_source in pairs({ "energy_source", "burner" }) do | ||||
|             if entity[energy_source] | ||||
|                 and entity[energy_source].type == "burner" | ||||
|                 and not table.contains(blacklist, entity.name) | ||||
|             and entity.energy_source.fuel_categories | ||||
|             and table.contains(entity.energy_source.fuel_categories, "chemical") | ||||
|                 and entity[energy_source].fuel_categories | ||||
|                 and table.contains(entity[energy_source].fuel_categories, "chemical") | ||||
|             then | ||||
|             table.insert(entity.energy_source.fuel_categories, "wood") | ||||
|                 table.insert(entity[energy_source].fuel_categories, "wood") | ||||
|             end | ||||
|         end | ||||
|     end | ||||
| end | ||||
|  | @ -31,3 +33,4 @@ end | |||
| update_fuel_categories(data.raw["boiler"]) | ||||
| update_fuel_categories(data.raw["reactor"]) | ||||
| update_fuel_categories(data.raw["car"]) | ||||
| update_fuel_categories(data.raw["generator-equipment"]) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Simon Brodtmann
						Simon Brodtmann