Fix performance bug when sliding along bottom/right walls

If the direction we're sliding in has a step of 0, we can return at that
point to prevent excessive looping.