Permalink
Browse files

fix negative tmp sing possibly generating max particles

  • Loading branch information...
jacob1 committed Jan 17, 2015
1 parent 8c1db51 commit 94e635b65dd01a95b79d3269f2b782440f87cdb4
Showing with 4 additions and 6 deletions.
  1. +4 −6 src/simulation/elements/SING.cpp
@@ -49,7 +49,7 @@ Element_SING::Element_SING()
//#TPT-Directive ElementHeader Element_SING static int update(UPDATE_FUNC_ARGS)
int Element_SING::update(UPDATE_FUNC_ARGS)
{
int r, rx, ry, cry, crx, nb, j, spawncount;
int r, rx, ry, cry, crx, nb, spawncount;
int singularity = -parts[i].life;
float angle, v;
@@ -82,11 +82,9 @@ int Element_SING::update(UPDATE_FUNC_ARGS)
}
}
}
spawncount = (parts[i].tmp>255)?255:parts[i].tmp;
if (spawncount>=1)
spawncount = spawncount/8;
spawncount = spawncount*spawncount*M_PI;
for (j=0;j<spawncount;j++)
spawncount = std::abs(parts[i].tmp);
spawncount = (spawncount>255) ? 3019 : std::pow((int)(spawncount/8), 2)*M_PI;
for (int j = 0;j < spawncount; j++)
{
switch(rand()%3)
{

0 comments on commit 94e635b

Please sign in to comment.