Skip to content

Commit

Permalink
stop neut from dragging particles inside energy walls, fixes jacob#18
Browse files Browse the repository at this point in the history
  • Loading branch information
mniip committed Jan 30, 2014
1 parent 250b522 commit 1266307
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/simulation/Simulation.cpp
Expand Up @@ -2345,6 +2345,8 @@ int Simulation::try_move(int i, int x, int y, int nx, int ny)
if (s && !(elements[s&0xFF].Properties&PROP_NEUTPENETRATE))
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(bmap[y/CELL][x/CELL] == WL_ALLOWENERGY)
return 1; // do not drag target particle into an energy only wall
if (s)
{
pmap[ny][nx] = (s&~(0xFF))|parts[s>>8].type;
Expand Down

0 comments on commit 1266307

Please sign in to comment.