The International Simutrans Forum

PakSets and Customization => Pak128.Britain => Pak128.Britain Bug Reports => Topic started by: sanna on July 13, 2009, 06:40:58 pm

Title: Non-functional power plants - deliberate or not?
Post by: sanna on July 13, 2009, 06:40:58 pm
AFAICT the power plants included in pakBritain cannot supply power. I am very well aware that the pak is under construction and that perhaps this is simply something that has not come under scrutiny as yet, in which case I will try to be more patient. *smile*

Trying to see how something is defined as a power supplier I came across a hack in the besch/reader/factory_reader.cc:223
Code: [Select]
besch->electricity_producer = ( fab_name_len>11   &&  (strcmp(besch->get_name()+fab_name_len-9, "kraftwerk")==0  ||  strcmp(besch->get_name()+fab_name_len-11, "Power Plant")==0) );
which AFAICT means that in order to be considered an electricity producer, the name of the industry has to end in either 'kraftwerk' or 'Power Plant', and there is no parameter to be set in the .dat-file of the industry.

None of the various power plants in coal-power-stations.dat and oil-power-station.dat fulfills the requirement of this hack. But maybe then these are not intended to be functioning power plants?
Title: Re: Non-functional power plants - deliberate or not?
Post by: The Hood on July 13, 2009, 08:38:19 pm
No they are meant to be functioning - Jamespetts changed a lot of names in his efforts on industry balancing, but I'm guessing he didn't know about the "kraftwerk" hack so they got dropped.  This will need updating - thanks for the spot and sorry I didn't catch it before release.
Title: Re: Non-functional power plants - deliberate or not?
Post by: jamespetts on July 13, 2009, 09:35:14 pm
Sanna,

oops - yes, The Hood is right. I was not aware of the requirement. We'll have to change the names in due course (and the translation texts with them).

Edit: Also, at the same time, the victoriancoalmine.dat file needs to be removed from the SVN.