From d88c18adaf86b9120498cbece605062891fbf34e Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Tue, 13 Oct 2015 00:49:42 +0100 Subject: [PATCH] Fix collision detection for liquids on top of streamlines --- src/simulation/Simulation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 2723701ac8..06499299df 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -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; } } @@ -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 } }