From 94e635b65dd01a95b79d3269f2b782440f87cdb4 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sat, 17 Jan 2015 14:45:20 -0500 Subject: [PATCH] fix negative tmp sing possibly generating max particles --- src/simulation/elements/SING.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/simulation/elements/SING.cpp b/src/simulation/elements/SING.cpp index 5df3d19f7..f38d7bfcd 100644 --- a/src/simulation/elements/SING.cpp +++ b/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;j255) ? 3019 : std::pow((int)(spawncount/8), 2)*M_PI; + for (int j = 0;j < spawncount; j++) { switch(rand()%3) {