
293 So.2d 918 (1974)
Stanley NORRIS, Plaintiff-Appellee,
v.
ALLSTATE INSURANCE COMPANY, Defendant-Appellant.
No. 4501.
Court of Appeal of Louisiana, Third Circuit.
April 23, 1974.
Rehearing Denied May 14, 1974.
Writ Refused July 1, 1974.
*919 Allen & Gooch by Joel L. Gooch, Lafayette, for defendant-appellant.
Thompson & Sellers by Charles M. Thompson, Jr., Abbeville, for plaintiff-appellee.
Franklin, Moore, Beychok & Cooper by William Henry Cooper, Jr., Baton Rouge, for defendant-appellee.
Before CULPEPPER, MILLER and WATSON, JJ.
MILLER, Judge.
Allstate Insurance Company appeals from a judgment condemning it to pay plaintiff Stanley Norris $12,466.58. The trial court refused to apply the subrogation clause in a homeowner policy issued by Allstate to Norris since Allstate was the insurer of the tortfeasor as well. We reverse that holding.
The parties stipulated that Norris purchased a new mobile home; that the vendor carried liability insurance with Allstate; that the mobile home was destroyed by fire caused by the mobile home vendor's negligence; that at the time of the fire loss, Norris was insured under a homeowner policy issued by Allstate; and that under the homeowner policy, Allstate paid the policy limits of $11,206.58 to Norris which covered all but $1260 of the property loss.
After Allstate paid Norris the $11,206.58 under the homeowner policy, Norris sued Allstate and its insured under vendor's liability policy claiming $12,466.58 as property damage. Allstate intervened as party plaintiff pursuant to its contractual right of subrogation in the homeowner policy, to the extent of its $11,206.58 payment to Norris. Allstate by supplemental and amended answer raised the affirmative defense of extinguishment of the portion of the tort obligation which was subrogated. Norris filed an exception of no cause or right of action to Allstate's intervention. The trial judge sustained this exception, and rendered judgment in favor of Norris and against Allstate for $12,466.58. We ultimately conclude Allstate specially pleaded and proved an affirmative defense that the subrogated portion of the tort claim, i. e., $11,206.58, is extinguished by confusion.
The sole question is whether or not an insurer loses its homeowner policy contractual right of subrogation to its payment for a fire loss when the insurer is also the comprehensive general liability insurer of the tortfeasor.[1] Counsel has not cited cases precisely in point and our research reveals none. We therefore undertake to review cases cited by the trial judge and litigants to determine their applicability.
Gunter v. Lord, 242 La. 943, 140 So.2d 11 (1962), involved the question of whether an injured passenger in an insured vehicle may recover under both the medical expense provisions of the policy and the liability coverage. Only one policy was involved. Double recovery was denied on finding the parties intended that medical payments were to be provided in all cases "... but, in the event of tortious conduct on the part of the insured, that such payments would satisfy the claim for damages normally awarded for those expenditures." 140 So.2d at 16. The court went on to say, however, that had the insured party been indemnified by insurance provided for him through some other source which the wrongdoer did not contribute *920 to, a reduction of damages would not necessarily follow. In making this statement, the court did not have before it the matter of subrogation.
Sonnier v. State Farm Mutual Automobile Ins. Co., 179 So.2d 467 (La.App. 3 Cir. 1965), also involved double recovery for medical payments for injuries sustained in an automobile accident. Plaintiff and tortfeasor were both insured by State Farm. State Farm paid plaintiff under her policy's medical payments clause, and claimed credit for this amount in answer to plaintiff's suit for personal injuries against State Farm as insurer of the alleged tortfeasor. We distinguished Gunter on the basis that Gunter involved only one policy, while two separate policies were involved in Sonnier. We noted as particularly persuasive the statement by the Supreme Court in Gunter which acknowledged the possibility of double recovery where the injured party had received whole or partial indemnification for injuries pursuant to insurance provided by a source other than that of the wrongdoer. We discerned the contractual intent of the parties as did the Supreme Court in Gunter. The named insured in his policy with State Farm intended that persons occupying the insured's car would receive medical payments irrespective of fault; and that the tortfeasor, under its contractual undertaking with State Farm, intended that his full tort liability be paid. We went on to discuss the effects of the position urged by State Farm at 179 So.2d page 469. That language was relied upon most heavily by the trial judge in the instant case and was quoted by him. Of primary significance, however, was the nature of the position urged by State Farm. State Farm was there contending that the medical payments paid plaintiff under its contract with the named insured should be allowed as a credit against plaintiff's tort claim. Subrogation was not specifically alluded to nor considered in that opinion.
Trahan v. Gulf Crews, Inc., 246 So.2d 280 (La.App. 3 Cir. 1971), involved a Jones Act suit for wrongful death. Gulf Crews had paid premiums for a $5,000 group life insurance policy insuring its employees. It contended that damages awarded against it in the wrongful death action should be reduced by $5,000. We held that the policy purchased by Gulf Crews created contractual obligations unrelated to the question of tort liability, and disallowed the offset. Again, subrogation was not an issue.
Dupre v. Vidrine, 261 So.2d 288 (La. App. 3 Cir. 1972), was concerned with recovery of medical expenses. Vidrine was sued for past due bills for medical care rendered him and members of his family resulting from injuries arising out of a collision with a vehicle driven by Guillory. Both Vidrine and Guillory carried insurance with Southern Farm Bureau. Vidrine signed a release in settlement of all claims against Guillory and Guillory's insurer Southern Farm Bureau. In the suit by the physician against Vidrine, Vidrine third partied Southern Farm Bureau for payment of his medical expenses under the medical payments coverage of Vidrine's policy. Southern Farm Bureau alleged that the release of the tortfeasor constituted an impairment of its subrogation rights. We held that Southern Farm Bureau's subrogation rights were not impaired since they had only been deprived of that right against themselves and their own insured. Concerning Southern Farm Bureau's defense based on policy provisions, we stated:

CONTENTION THAT POLICY PROVISION PREVENTS DOUBLE RECOVERY
Under "Part II, Medical Payments-Coverage C" of the policy issued to Vidrine, we find the following provision:

"PROVIDED THAT NO PAYMENTS shall be made under Coverage C, except under Division 1(b), unless the person to or for whom such payment is made shall have executed a written *921 agreement that the amount of such payment shall be applied toward the settlement of any claim, or the satisfaction of any judgment or damages entered in his favor, against any insured because of bodily injury arising out of any accident to which liability Coverage A applies."
Southern Farm contends this clause prevents Vidrine from recovering medical payments since they must be applied toward the settlement of any claim under Coverage A (Bodily Injury Liability). This would certainly be true if recovery was being sought under the Medical Payments coverage and the Bodily Injury Liability coverage of the same policy against "any insured" under that policy. However, the settlement in the present case was made under a different policy with a person who is not an insured under Vidrine's policy.
The clause quoted above requires only that medical payments be applied toward the settlement of any bodily injury claim against "any insured" under this policy. It does not require that medical payments be applied toward the settlement of a claim against a person who is not an insured under this policy. Of course, the settlement in this case was made with Ulfay Guillory, who does not fall within any of the definitions of an insured under the policy. Thus, the clause in question has no application.
                     261 So.2d at 290-291.
After dismissing the defense based upon the release, we concluded "that Vidrine's double recovery of medical payments is not barred by the release, nor by the provisions of the policy, nor by the applicable law." 261 So.2d at 291 (emphasis added). Conventional subrogation was not considered.
These decisions are not applicable here. None purported to deal with an insurance contract which contained a subrogation clause. The controlling and decisive factor in each cited case was the court's endeavor to follow Gunter and ascertain the mutual intent of the parties.
To ascertain the common intention of the parties and to give effect theretoa cardinal rule in the interpretation of contracts, and incorporated in our Civil Code, Article 1945we turn to an examination of the policy provisions, bearing in mind that "All clauses of agreements are interpreted the one by the other, giving to each the sense that results from the entire act," Article 1955; in other words, "The contract must be viewed as a whole, and the intention of the parties gathered from all its parts, to the end of giving practical effect to the instrument in the way intended * * *." Calhoun v. Ardis, 144 La. 311, 313, 80 So. 548, 549. See Civil Code, Articles 1764, 1945-1962; Long Bell Petroleum Co. v. Tritico, 216 La. 426, and cases cited at 454, 43 So.2d 782.
                         140 So.2d at 15.
It was in keeping with this approach that we allowed double recovery in Sonnier and Vidrine where medical payments were involved, and in Trahan, where a life insurance provision was involved. In each case, no policy provision prevented double recovery. Not one of these cases involved contractual subrogation, either through provisions in a settlement agreement or through terms of a policy.[2]
*922 We now look to the terms of the policy. The subrogation clause in Norris' homeowner policy provides that upon payment of a fire loss "... Allstate shall succeed to all of the Insured's rights of recovery therefor, and the Insured shall do whatever is necessary to secure such rights and do nothing after loss to prejudice them."
Legal agreements have the effect of law upon the parties. LSA-C.C. art. 1945. We are bound to give effect to the terms of the contract. It is conceded that Allstate's subrogation could be exercised had the tortfeasor carried liability insurance with a different carrier. No convincing reason has been presented to lead us to refuse to apply the subrogation clause in this case.
The fact that Allstate has chosen to use the incidental demand of intervention to assert its rights under the subrogation clause, raises a procedural problem which must be initially considered. Under LSA-C.C. art. 1901, only a third person may intervene. Allstate being a defendant, it cannot intervene. Plaintiff's exception of no right of action to Allstate's intervention must be sustained, since Allstate lacks procedural capacity.
Nevertheless, we find Allstate has sufficiently alleged an affirmative defense based upon the subrogation clause. In its supplemental and amended petition of intervention, Allstate alleged alternatively, in part that:
"... by virtue of Allstate Insurance Company's payment to plaintiff as his homeowner's insurer of his losses for property damage, loss of contents, and additional living expenses, Allstate Insurance Company as the liability insurer of Jim Traxler Mobile Homes, Inc. is entitled to a credit therefor in recognition of the subrogation rights acquired by Allstate Insurance Company, as plaintiff's homeowner's insurer, as aforesaid." (Tr. 221).
This allegation sufficiently sets forth a set of facts from which a legal conclusion of extinguishment by confusion is found. As such, the pleading meets the requirement for affirmative defenses found in LSA-C.C.P. art. 1005. The affirmative defense of extinguishment by confusion is properly pled through operation of the last sentence in that article, which provides that an affirmative defense mistakenly designated as an incidental demand may, in the interest of justice, be treated as an affirmative defense.
We find that extinguishment of part of the obligation through confusion has occurred by virtue of the provisions of the subrogation clause. Confusion, a means of extinguishing obligations recognized in our Civil Code, takes place of right when the qualities of creditor and debtor become merged in the same person. LSA-C.C. arts. 2130, 2217. Confusion thus occurred under the provisions of Allstate's homeowner insurance contract when Allstate paid Norris. At that time, Allstate's qualities as creditor and debtor of the liability obligation merged, and the obligation was extinguished, except for the $1,260 loss Norris sustained which was not covered by the homeowner policy.
Norris asserts additionally that since Allstate collected premiums for two policies, it should be required to compensate him under bothpursuant to the mutual undertaking in the fire insurance policy, and to the liability provision providing coverage to the negligent party.
*923 The double premium argument is not persuasive. Allstate collected the premium on Norris' homeowner policy to insure Norris for a fire loss regardless of fault. The parties contracted as part of the consideration for writing that policy at the agreed premium, that if Norris sustained a fire loss due to another's fault, on payment of the loss Allstate would become subrogated to Norris' claim against the tortfeasor. Without the subrogation clause, the premium may have been higher. In any event, it was part of the consideration for the policy.
Allstate confessed liability under its liability insurance covering the negligent tortfeasor as to the $1,260 property loss sustained by Norris which was not insured by Norris' homeowner policy. The trial court's judgment is affirmed as to the award to Norris of $1,260 together with legal interest thereon. The judgment is reversed and set aside insofar as it awarded more than that amount. Costs of this appeal are assessed to plaintiff, Stanley Norris.
Affirmed in part; reversed in part.

ON APPLICATION FOR REHEARING
In his application for rehearing, Stanley Norris brings an error to our attention. In the opinion we referred to a quotation from Allstate's supplemental and amended petition of intervention at Tr. 221. In fact, the pleading was styled a supplemental and amended answer.
By correcting this factual error, we do not change the result. The pleading of an affirmative defense is properly accomplished through answer. The affirmative defense was thus before us by its urging through answer and through operation of LSA-C.C.P. art. 1005.
The application for rehearing is denied.
NOTES
[1]  It was conceded that Allstate would have a valid claim under its subrogation if tortfeasor had liability coverage with another carrier.
[2]  Although in Vidrine we considered impairment of subrogation rights, no mention was made of conventional subrogation, which is the issue before us. In Vidrine, reference to subrogation is to legal subrogation. LSA-C.C. art. 2161(3) provide that legal subrogation takes place "... [f]or the benefit of him who, being bound with others, or for others, for the payment of the debt, had an interest in discharging it." Unquestionably, Southern Farm Bureau could have been deemed bound with or for Guillory for tort damages, including medical payments. Southern Farm Bureau was also responsible for the medical expenses through its contract with Vidrine. Southern Farm Bureau's position was one of dual responsibility. Two obligations arose, one in tort as the result of Guillory's negligence, one in contract as the result of the contract of insurance. Payment of one did not discharge the other. Subrogation would not have taken place on payment of one obligation, since the co-existing obligation remained viable. Where no subrogation exists, there can be no impairment of subrogation rights. Defendant Allstate in the instant case would be in a similar position, were it not for the subrogation clause in its policy.
