Fix enemy safety detection. Add last enemy position to patrol waypoint on state change.