summaryrefslogtreecommitdiff
path: root/src/map/path.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/path.c')
-rw-r--r--src/map/path.c34
1 files changed, 11 insertions, 23 deletions
diff --git a/src/map/path.c b/src/map/path.c
index 21d14c815..3b33fce65 100644
--- a/src/map/path.c
+++ b/src/map/path.c
@@ -82,29 +82,17 @@ int path_blownpos(int16 m,int16 x0,int16 y0,int16 dx,int16 dy,int count)
dy=(dy>0)?1:((dy<0)?-1:0);
}
- while( count > 0 && (dx != 0 || dy != 0) ) {
- if( !md->getcellp(md,x0+dx,y0+dy,CELL_CHKPASS) ) {// attempt partial movement
- int fx = ( dx != 0 && md->getcellp(md,x0+dx,y0,CELL_CHKPASS) );
- int fy = ( dy != 0 && md->getcellp(md,x0,y0+dy,CELL_CHKPASS) );
- if( fx && fy )
- {
- if(rnd()&1)
- dx=0;
- else
- dy=0;
- }
- if( !fx )
- dx=0;
- if( !fy )
- dy=0;
- }
-
- x0 += dx;
- y0 += dy;
- count--;
- }
-
- return (x0<<16)|y0; //TODO: use 'struct point' here instead?
+ while( count > 0 && (dx != 0 || dy != 0) ) {
+ if( !md->getcellp(md,x0+dx,y0+dy,CELL_CHKPASS) ) {
+ break;
+ }
+
+ x0 += dx;
+ y0 += dy;
+ count--;
+ }
+
+ return (x0<<16)|y0; //TODO: use 'struct point' here instead?
}
/*==========================================