moves++;
moved=true;
}//if coordination has changed, inc the moves
- } while(cont && (w!=w_new) && ((h_below >= PF::FIELD_HEIGHT) || get(w,h_below)!=PF::CELL_EMPTY));
+ } while(cont && // still moving
+ (w!=w_new) && // didn't arrived
+ ((h_below >= PF::FIELD_HEIGHT) || (get(w,h_below)!=PF::CELL_EMPTY && get(w,h_below) != get(w,h))) // there is something below
+ );
do
{
cont=false;