Skip some calls to do_move for liquids
No liquid can occupy the same space as itself unless in E-Hole
This commit is contained in:
parent
420f8e7442
commit
ab7cd2e5f6
10
src/powder.c
10
src/powder.c
@ -2061,19 +2061,21 @@ killed:
|
||||
rt = 10;
|
||||
for (j=clear_x+r; j>=0 && j>=clear_x-rt && j<clear_x+rt && j<XRES; j+=r)
|
||||
{
|
||||
if (s=do_move(i, x, y, (float)j, fin_yf))
|
||||
if (((pmap[fin_y][j]&0xFF)!=t || bmap[fin_y/CELL][j/CELL])
|
||||
&& (s=do_move(i, x, y, (float)j, fin_yf)))
|
||||
{
|
||||
nx = (int)(parts[i].x+0.5f);
|
||||
ny = (int)(parts[i].y+0.5f);
|
||||
break;
|
||||
}
|
||||
if (fin_y!=clear_y && (s=do_move(i, x, y, (float)j, clear_yf)))
|
||||
if (fin_y!=clear_y && ((pmap[clear_y][j]&0xFF)!=t || bmap[clear_y/CELL][j/CELL])
|
||||
&& (s=do_move(i, x, y, (float)j, clear_yf)))
|
||||
{
|
||||
nx = (int)(parts[i].x+0.5f);
|
||||
ny = (int)(parts[i].y+0.5f);
|
||||
break;
|
||||
}
|
||||
if ((pmap[y][j]&255)!=t || (bmap[y/CELL][j/CELL] && bmap[y/CELL][j/CELL]!=WL_STREAM))
|
||||
if ((pmap[fin_y][j]&0xFF)!=t || (bmap[fin_y/CELL][j/CELL] && bmap[fin_y/CELL][j/CELL]!=WL_STREAM))
|
||||
break;
|
||||
}
|
||||
if (parts[i].vy>0)
|
||||
@ -2083,7 +2085,7 @@ killed:
|
||||
if (s==1)
|
||||
for (j=ny+r; j>=0 && j<YRES && j>=ny-rt && j<ny+rt; j+=r)
|
||||
{
|
||||
if (do_move(i, nx, ny, (float)nx, (float)j))
|
||||
if (((pmap[j][nx]&0xFF)!=t || bmap[j/CELL][nx/CELL]) && do_move(i, nx, ny, (float)nx, (float)j))
|
||||
break;
|
||||
if ((pmap[j][nx]&255)!=t || (bmap[j/CELL][nx/CELL] && bmap[j/CELL][nx/CELL]!=WL_STREAM))
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user