summaryrefslogtreecommitdiff
path: root/src/simulation/Simulation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/simulation/Simulation.cpp')
-rw-r--r--src/simulation/Simulation.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index ab4a852..a1ddb68 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -2278,6 +2278,7 @@ void Simulation::update_particles_i(int start, int inc)
int surround[8];
int surround_hconduct[8];
int lighting_ok=1;
+ unsigned int elem_properties;
float pGravX, pGravY, pGravD;
if (lighting_recreate>0)
@@ -2410,7 +2411,6 @@ void Simulation::update_particles_i(int start, int inc)
else
wireless[q][1] = 0;
}
- //the main particle loop function, goes over all particles.
for (i=0; i<=parts_lastActiveIndex; i++)
if (parts[i].type)
{
@@ -2420,25 +2420,32 @@ void Simulation::update_particles_i(int start, int inc)
kill_part(i);
continue;
}
- //printf("parts[%d].type: %d\n", i, parts[i].type);
- if (parts[i].life>0 && (ptypes[t].properties&PROP_LIFE_DEC))
+ elem_properties = ptypes[t].properties;
+ if (parts[i].life>0 && (elem_properties&PROP_LIFE_DEC))
{
// automatically decrease life
parts[i].life--;
- if (parts[i].life<=0 && (ptypes[t].properties&(PROP_LIFE_KILL_DEC|PROP_LIFE_KILL)))
+ if (parts[i].life<=0 && (elem_properties&(PROP_LIFE_KILL_DEC|PROP_LIFE_KILL)))
{
// kill on change to no life
kill_part(i);
continue;
}
}
- else if (parts[i].life<=0 && (ptypes[t].properties&PROP_LIFE_KILL))
+ else if (parts[i].life<=0 && (elem_properties&PROP_LIFE_KILL))
{
// kill if no life
kill_part(i);
continue;
}
+ }
+ //the main particle loop function, goes over all particles.
+
+ for (i=0; i<=parts_lastActiveIndex; i++)
+ if (parts[i].type)
+ {
+ t = parts[i].type;
x = (int)(parts[i].x+0.5f);
y = (int)(parts[i].y+0.5f);