Why is my AI only patrolling and not detecting the player?

I just realized that I’m using a library function I made to check line of sight, so to be complete: