Skip to content

Commit

Permalink
Prevent red BRAY from affecting FILT colour via DTEC
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonmj committed Mar 27, 2014
1 parent 4e478cf commit 11997cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/simulation/elements/ARAY.cpp
Expand Up @@ -138,6 +138,7 @@ int Element_ARAY::update(UPDATE_FUNC_ARGS)
}
} else if (destroy) {
if ((r&0xFF)==PT_BRAY) {
parts[r>>8].tmp = 2;
parts[r>>8].life = 1;
docontinue = 1;
//this if prevents red BRAY from stopping on certain materials
Expand Down
4 changes: 2 additions & 2 deletions src/simulation/elements/BRAY.cpp
Expand Up @@ -55,7 +55,7 @@ int Element_BRAY::graphics(GRAPHICS_FUNC_ARGS)
{
trans = cpart->life * 7;
if (trans>255) trans = 255;
if (cpart->ctype) {
if (cpart->ctype&0x3FFFFFFF) {
*colg = 0;
*colb = 0;
*colr = 0;
Expand All @@ -75,7 +75,7 @@ int Element_BRAY::graphics(GRAPHICS_FUNC_ARGS)
{
trans = cpart->life/4;
if (trans>255) trans = 255;
if (cpart->ctype) {
if (cpart->ctype&0x3FFFFFFF) {
*colg = 0;
*colb = 0;
*colr = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/elements/DTEC.cpp
Expand Up @@ -86,7 +86,7 @@ int Element_DTEC::update(UPDATE_FUNC_ARGS)
continue;
if ((r&0xFF) == parts[i].ctype && (parts[i].ctype != PT_LIFE || parts[i].tmp == parts[r>>8].ctype || !parts[i].tmp))
parts[i].life = 1;
if ((r&0xFF) == PT_PHOT || (r&0xFF) == PT_BRAY)
if ((r&0xFF) == PT_PHOT || ((r&0xFF) == PT_BRAY && parts[r>>8].tmp!=2))
{
setFilt = true;
photonWl = parts[r>>8].ctype;
Expand Down

0 comments on commit 11997cf

Please sign in to comment.