As title. I encounter this bug when I try to test my patch for the builders.
The cause of crash is that, Pak96.Comic sets the productivity's range [i.e. fab_besch->get_bereich()] to 0 for many of the factories (I didn't check all), and thus when 0 is fed into sim_async_rand(), division-by-zero error occurs.
Relevant code below :
Quote
void factory_edit_frame_t::change_item_info(sint32 entry)
{
if(entry>=0 && entry<(sint32)fablist.get_count()) {
const fabrik_besch_t *new_fab_besch = fablist[entry];
if(new_fab_besch!=fab_besch) {
fab_besch = new_fab_besch;
production = (fab_besch->get_produktivitaet()+sim_async_rand(fab_besch->get_bereich()) )<<(welt->ticks_bits_per_tag-18);
I don't know whether setting productivity range to 0 is valid or not, so I will leave it to Prissi/Dwachs to decide on how to fix it.
Edit :Forgot to mention, the Pak96.Comic I used for testing is the latest version, v0.4.6.
No prob to change this. I can use 1 in future. What do you think about it?
The game should never crash just because of the data in a pakset.
Problem sovled. Thank you Prissi. :)
@Sojo
Quote from: sojo on January 06, 2010, 08:42:36 PM
No prob to change this. I can use 1 in future. What do you think about it?
Judging from the change, Prissi has chosen to allow 0 for productivity range, so you don't need to change your pakset. ;)