If the accused benefits from a legal cause for exemption from punishment, the court shall find him guilty and exempt him from punishment. It shall rule, where appropriate, on the civil action, as set out in the second and third paragraphs of Article 464.