I struggled so much with catching pacman that I camped 2 pellets instead of chasing and it crashed the game.
Yeah pacmans ai avoids going for pellets close to ghosts so it seems that if there are no more suitable pellets it just crashes, sorry about that
Thanks for your comment, I appreciate it :3