summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-02-24 00:57:13 (GMT)
committer jacksonmj <mj-pt@jacksonmj.co.uk>2011-02-24 00:57:13 (GMT)
commit71a6654c036dc4ebb96c67dddc23594f4699cbb2 (patch)
treea106e07ecfe03f09defa7eb99bc8f762ab8dfcd8 /src
parent7ecaa1636267108d4975ee336522bf7beb4e117e (diff)
downloadpowder-71a6654c036dc4ebb96c67dddc23594f4699cbb2.zip
powder-71a6654c036dc4ebb96c67dddc23594f4699cbb2.tar.gz
Fix particles displaced by liquids moving to overlapping positions
Diffstat (limited to 'src')
-rw-r--r--src/powder.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/powder.c b/src/powder.c
index 2e5aef0..bb77385 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -1988,7 +1988,9 @@ killed:
if (try_move(i, x, y, j, clear_y))
{
parts[i].x = clear_xf+(j-clear_x);
+ parts[i].y = clear_yf;
nx = j;
+ ny = clear_y;
s = 1;
break;
}
@@ -2000,11 +2002,11 @@ killed:
else
r = -1;
if (s)
- for (j=clear_y+r; j>=0 && j<YRES && j>=clear_y-rt && j<clear_y+rt; j+=r)
+ for (j=ny+r; j>=0 && j<YRES && j>=ny-rt && j<ny+rt; j+=r)
{
- if (try_move(i, x, y, nx, j))
+ if (try_move(i, nx, ny, nx, j))
{
- parts[i].y = clear_yf+(j-clear_y);
+ parts[i].y += j-ny;
break;
}
if ((pmap[j][nx]&255)!=t || (bmap[j/CELL][nx/CELL] && bmap[j/CELL][nx/CELL]!=WL_STREAM))