Fixed friction crash

Fixed a crash while calculating friction if the player was on a block at
the right edge of the screen.