diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-13 00:37:32 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-13 00:37:32 (GMT) |
| commit | 0cb47ab93cb7474f24c867ec0b9b9c9ac2dbf487 (patch) | |
| tree | 316f4236cae91cbaf469c5a295e060ab5f1ce84d /src/simulation/elements/BCLN.cpp | |
| parent | f0778c20332cc837a0d05996292a6e5e6265a9d7 (diff) | |
| download | powder-0cb47ab93cb7474f24c867ec0b9b9c9ac2dbf487.zip powder-0cb47ab93cb7474f24c867ec0b9b9c9ac2dbf487.tar.gz | |
TPT: Remember ctype when cloning lava
Diffstat (limited to 'src/simulation/elements/BCLN.cpp')
| -rw-r--r-- | src/simulation/elements/BCLN.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/simulation/elements/BCLN.cpp b/src/simulation/elements/BCLN.cpp index 3db0654..281ecb2 100644 --- a/src/simulation/elements/BCLN.cpp +++ b/src/simulation/elements/BCLN.cpp @@ -71,21 +71,29 @@ int Element_BCLN::update(UPDATE_FUNC_ARGS) continue; if ((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && (r&0xFF)!=PT_BCLN && (r&0xFF)!=PT_STKM && - (r&0xFF)!=PT_STKM2 && (r&0xFF)!=PT_PBCN && + (r&0xFF)!=PT_PBCN && (r&0xFF)!=PT_STKM2 && (r&0xFF)<PT_NUM) { parts[i].ctype = r&0xFF; - if ((r&0xFF)==PT_LIFE) + if ((r&0xFF)==PT_LIFE || (r&0xFF)==PT_LAVA) parts[i].tmp = parts[r>>8].ctype; } } } else { if (parts[i].ctype==PT_LIFE) sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype|(parts[i].tmp<<8)); - else sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype); + else + { + int np = sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype); + if (np>=0) + { + if (parts[i].ctype==PT_LAVA && parts[i].tmp>0 && parts[i].tmp<PT_NUM && sim->elements[parts[i].tmp].HighTemperatureTransition==PT_LAVA) + parts[np].ctype = parts[i].tmp; + } + } } return 0; } -Element_BCLN::~Element_BCLN() {}
\ No newline at end of file +Element_BCLN::~Element_BCLN() {} |
