Permalink
Browse files

fix particle #0 not being removed from the photons map when moving

  • Loading branch information...
jacob1 committed Sep 9, 2018
1 parent 3707ecd commit 7f215a6a17cfb3f8373000d73530f56c11708674
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/simulation/Simulation.cpp
@@ -2726,9 +2726,12 @@ int Simulation::do_move(int i, int x, int y, float nxf, float nyf)
parts[i].y = nyf;
if (ny!=y || nx!=x)
{
if (ID(pmap[y][x])==i) pmap[y][x] = 0;
else if (ID(photons[y][x])==i) photons[y][x] = 0;
if (nx<CELL || nx>=XRES-CELL || ny<CELL || ny>=YRES-CELL)//kill_part if particle is out of bounds
if (ID(pmap[y][x]) == i)
pmap[y][x] = 0;
if (ID(photons[y][x]) == i)
photons[y][x] = 0;
// kill_part if particle is out of bounds
if (nx < CELL || nx >= XRES - CELL || ny < CELL || ny >= YRES - CELL)
{
kill_part(i);
return -1;

0 comments on commit 7f215a6

Please sign in to comment.