Show subcategories on a parent category page

This code checks if you’re on a category page, and if so it lists all the categories that are children of the current category.

if (is_category()) {
  $this_category = get_category($cat);
  if (get_category_children($this_category->cat_ID) != "") {
    wp_list_categories('orderby=id&show_count=0&title_li=&use_desc_for_title=1&child_of=".$this_category->cat_ID);
  }
}