Added possibly bugged code to prevent Kings from moving into check.