Refactored consecutive collision detection code

Now it's much better and detect other cases of multiple consecutive
collisions too.