Both cases involve knowingly causing pain. Whether pain is the intention does not matter. Both cases, the person knows what kind of pain they will cause and they still do it. The suicidal person just inflicts infinetely more pain.