summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/powder.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/powder.c b/src/powder.c
index 4d8ba45..8348fb0 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -253,11 +253,9 @@ int try_move(int i, int x, int y, int nx, int ny)
parts[e].x += x-nx;
parts[e].y += y-ny;
+ pmap[(int)(parts[e].y+0.5f)][(int)(parts[e].x+0.5f)] = (e<<8)|parts[e].type;
}
- pmap[ny][nx] = (i<<8)|parts[i].type;
- pmap[y][x] = r;
-
return 1;
}
@@ -2030,10 +2028,18 @@ killed:
}
nx = (int)(parts[i].x+0.5f);
ny = (int)(parts[i].y+0.5f);
- if (nx<CELL || nx>=XRES-CELL || ny<CELL || ny>=YRES-CELL)
+ if (ny!=y || nx!=x)
{
- kill_part(i);
- continue;
+ if ((pmap[y][x]>>8)==i) pmap[y][x] = 0;
+ if (nx<CELL || nx>=XRES-CELL || ny<CELL || ny>=YRES-CELL)
+ {
+ kill_part(i);
+ continue;
+ }
+ if (t==PT_PHOT)
+ photons[ny][nx] = t|(i<<8);
+ else
+ pmap[ny][nx] = t|(i<<8);
}
}
if (framerender) {