Castling logic updated. When both castling disabled, stop checking castling