Modified the player wall function to get rid of some bugs.