Small fix for liquid and powder movement

This commit is contained in:
jacksonmj 2011-05-15 20:18:24 +08:00 committed by Simon Robertshaw
parent 68c4d6d621
commit 7482e4d071

View File

@ -2022,13 +2022,12 @@ killed:
// but no point trying this if particle is stuck in a block of identical particles // but no point trying this if particle is stuck in a block of identical particles
dx = parts[i].vx - parts[i].vy*r; dx = parts[i].vx - parts[i].vy*r;
dy = parts[i].vy + parts[i].vx*r; dy = parts[i].vy + parts[i].vx*r;
if (fabsf(dy)>fabsf(dx)) { if (fabsf(dy)>fabsf(dx))
dx /= fabsf(dy); mv = fabsf(dy);
dy /= fabsf(dy); else
} else { mv = fabsf(dx);
dx /= fabsf(dx); dx /= mv;
dy /= fabsf(dx); dy /= mv;
}
if (do_move(i, x, y, clear_xf+dx, clear_yf+dy)) if (do_move(i, x, y, clear_xf+dx, clear_yf+dy))
{ {
parts[i].vx *= ptypes[t].collision; parts[i].vx *= ptypes[t].collision;