diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2012-10-03 14:39:14 (GMT) |
|---|---|---|
| committer | jacksonmj <mj-pt@jacksonmj.co.uk> | 2012-10-03 14:42:30 (GMT) |
| commit | 707c11203ea826208fdf2ad7a3688e1e33c20916 (patch) | |
| tree | 364995a816c049e28d29f7c75db460011bbc209f /src/simulation/elements/CO2.cpp | |
| parent | b98f5faaceff4b8dee4de763678b7c73a1143476 (diff) | |
| download | powder-707c11203ea826208fdf2ad7a3688e1e33c20916.zip powder-707c11203ea826208fdf2ad7a3688e1e33c20916.tar.gz | |
Fix extra BUBW sometimes being produced when CO2 dissolves
Diffstat (limited to 'src/simulation/elements/CO2.cpp')
| -rw-r--r-- | src/simulation/elements/CO2.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/simulation/elements/CO2.cpp b/src/simulation/elements/CO2.cpp index 4e29286..ca5cc31 100644 --- a/src/simulation/elements/CO2.cpp +++ b/src/simulation/elements/CO2.cpp @@ -71,11 +71,11 @@ int Element_CO2::update(UPDATE_FUNC_ARGS) } if (((r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW) && 1>(rand()%250)) { - sim->part_change_type(i,x,y,PT_CBNW); + sim->part_change_type(r>>8, x+rx, y+ry, PT_CBNW); if (parts[i].ctype==5) //conserve number of water particles - ctype=5 means this CO2 hasn't released the water particle from BUBW yet - sim->create_part(r>>8, x+rx, y+ry, PT_CBNW); + sim->create_part(i, x, y, PT_WATR); else - sim->kill_part(r>>8); + sim->kill_part(i); } } if (parts[i].temp > 9773.15 && sim->pv[y/CELL][x/CELL] > 200.0f) |
