diff options
Diffstat (limited to 'src/powder.c')
| -rw-r--r-- | src/powder.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/powder.c b/src/powder.c index ac710f6..6360529 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1432,6 +1432,7 @@ void update_particles_i(pixel *vid, int start, int inc) int surround[8]; int surround_hconduct[8]; int lighting_ok=1; + unsigned int elem_properties; float pGravX, pGravY, pGravD; if (sys_pause&&lighting_recreate>0) @@ -1706,7 +1707,6 @@ void update_particles_i(pixel *vid, 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) { @@ -1716,26 +1716,30 @@ void update_particles_i(pixel *vid, 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); |
