diff --git a/includes/powder.h b/includes/powder.h index 71ac93d72..76969adba 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -948,6 +948,7 @@ extern int airMode; extern particle *parts; extern particle *cb_parts; +extern int parts_lastActiveIndex; extern unsigned char bmap[YRES/CELL][XRES/CELL]; extern unsigned char emap[YRES/CELL][XRES/CELL]; diff --git a/src/graphics.c b/src/graphics.c index 5a1061e53..4be05a607 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1654,7 +1654,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx, ny, 100, 100, 100, 80); } } - for (i = 0; iparts_lastActiveIndex) parts_lastActiveIndex = i; + parts[i].dcolour = 0; if (t==PT_GLAS) { @@ -1254,7 +1256,7 @@ int nearest_part(int ci, int t) int i = 0; int cx = (int)parts[ci].x; int cy = (int)parts[ci].y; - for (i=0; i=NPART-1) parts[lastPartUnused].life = -1; + else parts[lastPartUnused].life = parts_lastActiveIndex+1; + parts_lastActiveIndex = lastPartUsed; for (y=0; y