Skip to content

Commit

Permalink
Make CRAY copy its own life to particles it creates (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
cxi authored and jacob1 committed Sep 10, 2016
1 parent 797f935 commit ad4ef65
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/simulation/elements/CRAY.cpp
Expand Up @@ -30,7 +30,7 @@ Element_CRAY::Element_CRAY()
HeatConduct = 0;
Description = "Particle Ray Emitter. Creates a beam of particles set by its ctype, with a range set by tmp.";

Properties = TYPE_SOLID|PROP_LIFE_DEC;
Properties = TYPE_SOLID;

LowPressure = IPL;
LowPressureTransition = NT;
Expand Down Expand Up @@ -68,7 +68,7 @@ int Element_CRAY::update(UPDATE_FUNC_ARGS)
}
}
// only fire when life is 0, but nothing sets the life right now
else if (parts[i].life==0)
else
{
for (int rx =-1; rx <= 1; rx++)
for (int ry = -1; ry <= 1; ry++)
Expand Down Expand Up @@ -98,6 +98,8 @@ int Element_CRAY::update(UPDATE_FUNC_ARGS)
if (colored)
parts[nr].dcolour = colored;
parts[nr].temp = parts[i].temp;
if (parts[i].life>0)
parts[nr].life = parts[i].life;
if(!--partsRemaining)
docontinue = 0;
}
Expand Down

0 comments on commit ad4ef65

Please sign in to comment.