Page 1 of 1

Burner drain?

Posted: Thu Oct 03, 2019 7:46 pm
by moon69
I've modded a pump to use a burner EnergySource.

Watching LuaBurner.remaining_burning_fuel, I can't figure out why it's slowly draining fuel (once I stick a piece of coal in it) even when freshly built and not connected to any pipes.

Code: Select all

local ass = util.table.deepcopy(data.raw["pump"]["pump"])
ass.name = "testpmp1"
ass.minable.result = ass.name

ass.energy_usage = "1kW"
ass.energy_source =
{
	type = "burner",	
	emissions_per_minute = 0,
	fuel_inventory_size = 5,
}
	  	  
data.raw["pump"][ass.name] = ass
Why is this?

Re: Burner drain?

Posted: Thu Oct 03, 2019 8:07 pm
by Bilka
Because of:
Pump update function wrote: if (!pumpedAnything)
this->energySource->extractEnergyAndPollute(prototype.energyUsage * ElectricEnergySource::restingEnergyConsumption, ...);
No idea why this code exists. Consider making a bug report, most likely that code was just not adjusted after the possibility to use non-electric energy sources in the pump was added.

Re: Burner drain?

Posted: Thu Oct 03, 2019 9:03 pm
by moon69

Re: Burner drain?

Posted: Thu Oct 03, 2019 9:09 pm
by moon69
Now I think it about, perhaps a good fix is to add drain property to Burner EnergySource?

Might be fun to make burner machine that needs to be kept 'hot' or it breaks.