From 707c11203ea826208fdf2ad7a3688e1e33c20916 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Wed, 3 Oct 2012 15:39:14 +0100 Subject: [PATCH] Fix extra BUBW sometimes being produced when CO2 dissolves --- src/simulation/elements/CO2.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/simulation/elements/CO2.cpp b/src/simulation/elements/CO2.cpp index 4e2928649..ca5cc3109 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)