diff options
| author | jacob1 <jfu614@gmail.com> | 2013-03-06 19:23:26 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-03-06 19:23:26 (GMT) |
| commit | 9316054ab2c55ea3a01a08a505da424a7a5d6688 (patch) | |
| tree | 0641a8356e54d7045e46562ff7b98d4186c2f008 /src | |
| parent | 037618e6f8e6a37574f7ef8ffd90e490fb0ea137 (diff) | |
| download | powder-9316054ab2c55ea3a01a08a505da424a7a5d6688.zip powder-9316054ab2c55ea3a01a08a505da424a7a5d6688.tar.gz | |
fix CRAY(SPRK) bugs (?)
Diffstat (limited to 'src')
| -rw-r--r-- | src/preview/PreviewModel.cpp | 1 | ||||
| -rw-r--r-- | src/simulation/elements/CRAY.cpp | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/preview/PreviewModel.cpp b/src/preview/PreviewModel.cpp index ea3904d..274eb40 100644 --- a/src/preview/PreviewModel.cpp +++ b/src/preview/PreviewModel.cpp @@ -314,5 +314,6 @@ PreviewModel::~PreviewModel() { delete saveComments->at(i); delete saveComments; } + saveDataBuffer.clear(); } diff --git a/src/simulation/elements/CRAY.cpp b/src/simulation/elements/CRAY.cpp index f0d276a..3999f1f 100644 --- a/src/simulation/elements/CRAY.cpp +++ b/src/simulation/elements/CRAY.cpp @@ -78,8 +78,9 @@ int Element_CRAY::update(UPDATE_FUNC_ARGS) continue; if ((r&0xFF)==PT_SPRK && parts[r>>8].life==3) { //spark found, start creating unsigned int colored = 0; - int destroy = (parts[r>>8].ctype==PT_PSCN)?1:0; - int nostop = (parts[r>>8].ctype==PT_INST)?1:0; + bool destroy = parts[r>>8].ctype==PT_PSCN; + bool nostop = parts[r>>8].ctype==PT_INST; + bool createSpark = (parts[r>>8].ctype==PT_INWR); int partsRemaining = 255; if (parts[i].tmp) //how far it shoots partsRemaining = parts[i].tmp; @@ -88,7 +89,7 @@ int Element_CRAY::update(UPDATE_FUNC_ARGS) break; } r = pmap[y+nyi+nyy][x+nxi+nxx]; - if (!sim->IsWallBlocking(x+nxi+nxx, y+nyi+nyy, parts[i].ctype) && (!sim->pmap[y+nyi+nyy][x+nxi+nxx] || (parts[i].ctype == PT_SPRK && parts[r>>8].type != PT_BREC && !destroy))) { // create, also set color if it has passed through FILT + if (!sim->IsWallBlocking(x+nxi+nxx, y+nyi+nyy, parts[i].ctype) && (!sim->pmap[y+nyi+nyy][x+nxi+nxx] || createSpark)) { // create, also set color if it has passed through FILT int nr; if (parts[i].ctype == PT_LIFE) nr = sim->create_part(-1, x+nxi+nxx, y+nyi+nyy, parts[i].ctype|(parts[i].tmp2<<8)); @@ -98,7 +99,7 @@ int Element_CRAY::update(UPDATE_FUNC_ARGS) parts[nr].dcolour = colored; parts[nr].temp = parts[i].temp; } - if((!destroy || (parts[i].ctype != PT_SPRK &&parts[r>>8].type != PT_BREC)) && !--partsRemaining) + if(!--partsRemaining) docontinue = 0; } else if ((r&0xFF)==PT_FILT) { // get color if passed through FILT colored = wavelengthToDecoColour(parts[r>>8].ctype); |
