Skip to content

Commit

Permalink
Fix collision detection for liquids on top of streamlines
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonmj committed Oct 12, 2015
1 parent 59377e4 commit d88c18a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/simulation/Simulation.cpp
Expand Up @@ -4492,7 +4492,7 @@ void Simulation::UpdateParticles(int start, int end)
break;
}
// A particle of a different type, or a wall, was found. Stop trying to move any further horizontally unless the wall should be completely invisible to particles.
if (bmap[ny/CELL][nx/CELL]!=WL_STREAM)
if ((pmap[ny][nx]&0xFF)!=t || bmap[ny/CELL][nx/CELL]!=WL_STREAM)
break;
}
}
Expand Down Expand Up @@ -4542,7 +4542,7 @@ void Simulation::UpdateParticles(int start, int end)
if ((pmap[ny][nx]&0xFF)!=t || bmap[ny/CELL][nx/CELL])
{
s = do_move(i, clear_x, clear_y, nxf, nyf);
if (s || bmap[ny/CELL][nx/CELL]!=WL_STREAM)
if (s || (pmap[ny][nx]&0xFF)!=t || bmap[ny/CELL][nx/CELL]!=WL_STREAM)
break; // found the edge of the liquid and movement into it succeeded, so stop moving down
}
}
Expand Down

0 comments on commit d88c18a

Please sign in to comment.