diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2013-09-08 16:28:51 (GMT) |
|---|---|---|
| committer | jacksonmj <mj-pt@jacksonmj.co.uk> | 2013-09-08 16:28:51 (GMT) |
| commit | 45dc8ac7572a920fb60ce032e0acbded5dc33a7e (patch) | |
| tree | 7d477d2f4e5d9a1cc282d9f9363115fb9fbce013 /src | |
| parent | 7270461985cdbc7d07824c9a5a8ae1b0e4eb1229 (diff) | |
| download | powder-45dc8ac7572a920fb60ce032e0acbded5dc33a7e.zip powder-45dc8ac7572a920fb60ce032e0acbded5dc33a7e.tar.gz | |
Revert "Don't reset decorations when sparking with INWR+CRAY(most things)"
This reverts commit 5ad67f7778ede58e9708c43587d694e446a2377b.
Diffstat (limited to 'src')
| -rw-r--r-- | src/simulation/elements/CRAY.cpp | 39 |
1 files changed, 10 insertions, 29 deletions
diff --git a/src/simulation/elements/CRAY.cpp b/src/simulation/elements/CRAY.cpp index e673d33..b906c33 100644 --- a/src/simulation/elements/CRAY.cpp +++ b/src/simulation/elements/CRAY.cpp @@ -80,7 +80,7 @@ int Element_CRAY::update(UPDATE_FUNC_ARGS) unsigned int colored = 0; bool destroy = parts[r>>8].ctype==PT_PSCN; bool nostop = parts[r>>8].ctype==PT_INST; - bool createOnExisting = (parts[r>>8].ctype==PT_INWR); + bool createSpark = (parts[r>>8].ctype==PT_INWR); int partsRemaining = 255; if (parts[i].tmp) //how far it shoots partsRemaining = parts[i].tmp; @@ -89,36 +89,17 @@ 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) && (!r || createOnExisting)) { // 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 (createOnExisting) - { - if (r&0xFF) - { - if (parts[i].ctype == PT_SOAP) - parts[r>>8].dcolour = 0; - else if (parts[i].ctype == PT_FILT) - parts[r>>8].dcolour = colored; - else - nr = sim->create_part(-1, x+nxi+nxx, y+nyi+nyy, PT_SPRK); - if ((r&0xFF)==PT_FILT) - colored = wavelengthToDecoColour(Element_FILT::getWavelengths(&parts[r>>8])); - if (!--partsRemaining) - docontinue = 0; - } - } + if (parts[i].ctype == PT_LIFE) + nr = sim->create_part(-1, x+nxi+nxx, y+nyi+nyy, parts[i].ctype|(parts[i].tmp2<<8)); else - { - if (parts[i].ctype == PT_LIFE) - nr = sim->create_part(-1, x+nxi+nxx, y+nyi+nyy, parts[i].ctype|(parts[i].tmp2<<8)); - else - nr = sim->create_part(-1, x+nxi+nxx, y+nyi+nyy, parts[i].ctype); - if (nr!=-1) { - parts[nr].dcolour = colored; - parts[nr].temp = parts[i].temp; - if(!--partsRemaining) - docontinue = 0; - } + nr = sim->create_part(-1, x+nxi+nxx, y+nyi+nyy, parts[i].ctype); + if (nr!=-1) { + parts[nr].dcolour = colored; + parts[nr].temp = parts[i].temp; + if(!--partsRemaining) + docontinue = 0; } } else if ((r&0xFF)==PT_FILT) { // get color if passed through FILT colored = wavelengthToDecoColour(Element_FILT::getWavelengths(&parts[r>>8])); |
