diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-12 17:45:03 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-12 17:45:03 (GMT) |
| commit | 48459fc40d628d5701270f630afb1f8228cdfcae (patch) | |
| tree | 28c84a60fe1ffbe64afc899c08b4fd4e8afaa870 /src/simulation/elements | |
| parent | 391165409ddcf14b4a888b5aac90871999caa9a2 (diff) | |
| download | powder-48459fc40d628d5701270f630afb1f8228cdfcae.zip powder-48459fc40d628d5701270f630afb1f8228cdfcae.tar.gz | |
TPT: Change order of bomb loops - delete particles before creating sparks 089ea8b7a0
Diffstat (limited to 'src/simulation/elements')
| -rw-r--r-- | src/simulation/elements/BOMB.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/simulation/elements/BOMB.cpp b/src/simulation/elements/BOMB.cpp index b21be19..ccf56bd 100644 --- a/src/simulation/elements/BOMB.cpp +++ b/src/simulation/elements/BOMB.cpp @@ -77,18 +77,6 @@ int Element_BOMB::update(UPDATE_FUNC_ARGS) int nxi; int nxj; pmap[y][x] = 0; - for (nxj=-(rad+1); nxj<=(rad+1); nxj++) - for (nxi=-(rad+1); nxi<=(rad+1); nxi++) - if ((pow((float)nxi,2))/(pow((float)(rad+1),2))+(pow((float)nxj,2))/(pow((float)(rad+1),2))<=1) { - nb = sim->create_part(-1, x+nxi, y+nxj, PT_BOMB); - if (nb!=-1) { - parts[nb].tmp = 1; - parts[nb].life = 50; - parts[nb].temp = MAX_TEMP; - parts[nb].vx = rand()%20-10; - parts[nb].vy = rand()%20-10; - } - } for (nxj=-rad; nxj<=rad; nxj++) for (nxi=-rad; nxi<=rad; nxi++) if ((pow((float)nxi,2))/(pow((float)rad,2))+(pow((float)nxj,2))/(pow((float)rad,2))<=1) @@ -102,6 +90,18 @@ int Element_BOMB::update(UPDATE_FUNC_ARGS) parts[nb].temp = MAX_TEMP; } } + for (nxj=-(rad+1); nxj<=(rad+1); nxj++) + for (nxi=-(rad+1); nxi<=(rad+1); nxi++) + if ((pow((float)nxi,2))/(pow((float)(rad+1),2))+(pow((float)nxj,2))/(pow((float)(rad+1),2))<=1) { + nb = sim->create_part(-1, x+nxi, y+nxj, PT_BOMB); + if (nb!=-1) { + parts[nb].tmp = 1; + parts[nb].life = 50; + parts[nb].temp = MAX_TEMP; + parts[nb].vx = rand()%20-10; + parts[nb].vy = rand()%20-10; + } + } //CreateParts(x, y, 9, 9, PT_BOMB); //CreateParts(x, y, 8, 8, PT_NONE); sim->kill_part(i); @@ -137,4 +137,4 @@ int Element_BOMB::graphics(GRAPHICS_FUNC_ARGS) } -Element_BOMB::~Element_BOMB() {}
\ No newline at end of file +Element_BOMB::~Element_BOMB() {} |
