TPT: Make ELEC+water form H2 and O2 in the correct proportions 9b2c2a78a6

This commit is contained in:
Simon Robertshaw 2012-07-25 15:56:42 +01:00
parent 6dc7eaf43e
commit 57c356e495

View File

@ -95,14 +95,14 @@ int Element_ELEC::update(UPDATE_FUNC_ARGS)
}
if ((r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW || (r&0xFF)==PT_SLTW || (r&0xFF)==PT_CBNW)
{
if(rand()%2)
if(rand()<RAND_MAX/3)
{
sim->create_part(r>>8, x+rx, y+ry, PT_H2);
sim->create_part(r>>8, x+rx, y+ry, PT_O2);
return 1;
}
else
{
sim->create_part(r>>8, x+rx, y+ry, PT_O2);
sim->create_part(r>>8, x+rx, y+ry, PT_H2);
return 1;
}
}