summaryrefslogtreecommitdiff
path: root/src/simulation/elements/BOMB.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/simulation/elements/BOMB.cpp')
-rw-r--r--src/simulation/elements/BOMB.cpp26
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() {}