First of all, I might have totally misread the code, in which case this report is a mere annoyance, not a bug report...
It seemed to me that no matter how high I set the percentage for power coverage in the start up dialogue I got a random amount of power plants, which sent me looking into the code, more specifically bauer/fabrikbauer.cc.
In fabrikbauer_t::increase_industry_density:941-945 there is a loop that iterates through the cities and which I have ****umed is intended to add their power demand to the total demand needed:
const weighted_vector_tpl<stadt_t*>& staedte = welt->get_staedte();
for (weighted_vector_tpl<stadt_t*>::const_iterator i = staedte.begin(), end = staedte.end(); i != end; ++i)
{
electric_productivity += (*i)->get_power_demand() * 5120;
}
However, the preceding lines of code (927-939) seems to me to indicate that what is stored in electric_productivity is in fact power supply, not power demand, and that power demand is stored in total_produktivity:
ITERATE(welt->get_fab_list(), i)
{
//fabrik_t * fab = iter.get_current();
fabrik_t * fab = welt->get_fab_list()[i];
if(fab->get_besch()->is_electricity_producer())
{
electric_productivity += fab->get_base_production();
}
else
{
total_produktivity += fab->get_base_production();
}
}
This said, I must also add that I have no idea what the * 5120 tacked onto the (*i)->get_power_demand() does; I presume it must be related to power being calculated differently in different parts of the code. But its presence makes it (I think) impossible to simply replace electric_productivity with total_produktivity in the code; at least when I tried I ended up with nothing but power plants no matter how low I put the starting variable... This my lack of understanding of the various ways to calculate power have made it impossible for me to produce a patch
Still I hope this post can be useful, if for nothing else then for the possibility to scold me in public for my ignorance