diff --git a/src/powder.c b/src/powder.c index b178318ae..4ae5bca39 100644 --- a/src/powder.c +++ b/src/powder.c @@ -237,7 +237,7 @@ int try_move(int i, int x, int y, int nx, int ny) return 0; } - if ((pmap[ny][nx]&0xFF)==PT_CNCT)//why is this here + if ((pmap[ny][nx]&0xFF)==PT_CNCT)//stops CNCT being displaced by other particles return 0; if (parts[i].type==PT_CNCT && y>8)>=NPART) return 0; if ((s&0xFF) && (s&0xFF)>8)==e) pmap[ny][nx] = (s&~(0xFF))|parts[s>>8].type; + return 1; // if the element currently underneath neutron isn't NEUTPENETRATE, don't move anything except the neutron + // if nothing is currently underneath neutron, only move target particle + if (s) + { + pmap[ny][nx] = (s&~(0xFF))|parts[s>>8].type; + parts[s>>8].x = nx; + parts[s>>8].y = ny; + } + else pmap[ny][nx] = 0; parts[e].x = x; parts[e].y = y; pmap[y][x] = (e<<8)|parts[e].type; - parts[s>>8].x = nx; - parts[s>>8].y = ny; return 1; }