Revamped wall and ledge detection for locomotive enemies